Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

…oodle into MOODLE_22_STABLE
  • Loading branch information...
commit 30e1b798893f9408ecf304ddbe23ea2fd5eff1fd 2 parents d30043c + aed70c6
Aparup Banerjee nebgor authored
6 lib/filestorage/file_storage.php
@@ -987,6 +987,12 @@ public function create_file_from_string($file_record, $content) {
987 987 * @return stored_file instance
988 988 */
989 989 public function convert_image($file_record, $fid, $newwidth = NULL, $newheight = NULL, $keepaspectratio = true, $quality = NULL) {
  990 + if (!function_exists('imagecreatefromstring')) {
  991 + //Most likely the GD php extension isn't installed
  992 + //image conversion cannot succeed
  993 + throw new file_exception('storedfileproblem', 'imagecreatefromstring() doesnt exist. The PHP extension "GD" must be installed for image conversion.');
  994 + }
  995 +
990 996 if ($fid instanceof stored_file) {
991 997 $fid = $fid->get_id();
992 998 }
1  mod/data/field/picture/field.class.php
@@ -266,6 +266,7 @@ function update_thumbnail($content, $file) {
266 266 $fs->convert_image($file_record, $file, $this->field->param4, $this->field->param5, true);
267 267 return true;
268 268 } catch (Exception $e) {
  269 + debugging($e->getMessage());
269 270 return false;
270 271 }
271 272 }

0 comments on commit 30e1b79

Please sign in to comment.
Something went wrong with that request. Please try again.