mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
MDL-49627 core: Update uses of generate_image_thumbnail
This removes the need to write tempfiles in these locations.
This commit is contained in:
parent
b7067f065e
commit
2b53b13ff7
3 changed files with 5 additions and 16 deletions
|
@ -290,11 +290,7 @@ function label_generate_resized_image(stored_file $file, $maxwidth, $maxheight)
|
|||
$mimetype = $file->get_mimetype();
|
||||
if ($mimetype === 'image/gif' or $mimetype === 'image/jpeg' or $mimetype === 'image/png') {
|
||||
require_once($CFG->libdir.'/gdlib.php');
|
||||
$tmproot = make_temp_directory('mod_label');
|
||||
$tmpfilepath = $tmproot.'/'.$file->get_contenthash();
|
||||
$file->copy_content_to($tmpfilepath);
|
||||
$data = generate_image_thumbnail($tmpfilepath, $width, $height);
|
||||
unlink($tmpfilepath);
|
||||
$data = $file->generate_image_thumbnail($width, $height);
|
||||
|
||||
if (!empty($data)) {
|
||||
$fs = get_file_storage();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue