Skip to content
Permalink
Browse files

Merge branch 'MDL-27432_gd_error' of git://github.com/andyjdavis/moodle

  • Loading branch information...
Aparup Banerjee
Aparup Banerjee committed Dec 8, 2011
2 parents 983fb3f + 6b2f218 commit 357317fb6e3cf33a49eec8168700178da1754983
Showing with 7 additions and 0 deletions.
  1. +6 −0 lib/filestorage/file_storage.php
  2. +1 −0 mod/data/field/picture/field.class.php
@@ -987,6 +987,12 @@ public function create_file_from_string($file_record, $content) {
* @return stored_file instance
*/
public function convert_image($file_record, $fid, $newwidth = NULL, $newheight = NULL, $keepaspectratio = true, $quality = NULL) {
if (!function_exists('imagecreatefromstring')) {
//Most likely the GD php extension isn't installed
//image conversion cannot succeed
throw new file_exception('storedfileproblem', 'imagecreatefromstring() doesnt exist. The PHP extension "GD" must be installed for image conversion.');
}
if ($fid instanceof stored_file) {
$fid = $fid->get_id();
}
@@ -266,6 +266,7 @@ function update_thumbnail($content, $file) {
$fs->convert_image($file_record, $file, $this->field->param4, $this->field->param5, true);
return true;
} catch (Exception $e) {
debugging($e->getMessage());
return false;
}
}

0 comments on commit 357317f

Please sign in to comment.
You can’t perform that action at this time.