MDL-60819 core_files: fix exception thrown from generate_image_thumbnail

This function now requires gdlib.php.
This commit is contained in:
Jake Dallimore 2018-05-30 09:55:23 +08:00
parent 50e48a8f2d
commit 28c3f6e4d8

View File

@ -1063,6 +1063,9 @@ class stored_file {
* @return string|bool false if a problem occurs, the thumbnail image data otherwise
*/
public function generate_image_thumbnail($width, $height) {
global $CFG;
require_once($CFG->libdir . '/gdlib.php');
if (empty($width) or empty($height)) {
return false;
}