Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'MDL-27432_gd_error_21' of git://github.com/andyjdavis/m…

…oodle into MOODLE_21_STABLE
  • Loading branch information...
commit 47ec4ba7d849d08e4cfdbb5f1464a9c5b423ace1 2 parents 65bf17e + 5335ed5
@nebgor nebgor authored
View
6 lib/filestorage/file_storage.php
@@ -979,6 +979,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();
}
View
1  mod/data/field/picture/field.class.php
@@ -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;
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.