Skip to content
Snippets Groups Projects
Commit 21d3ff5a authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms Committed by Jan-Hendrik Willms
Browse files

stock images: copy uploaded file if image width is smaller than target width, fixes #4377

Closes #4377

Merge request studip/studip!3183
parent 28bb73d1
No related branches found
No related tags found
No related merge requests found
......@@ -20,13 +20,14 @@ final class Scaler
{
$image = $this->createImage($stockImage);
$width = imagesx($image);
if ($width < $targetWidth) {
return false;
$scaledImage = $image;
} else {
$scaledImage = imagescale($image, $targetWidth);
imagedestroy($image);
}
$scaledImage = imagescale($image, $targetWidth);
imagedestroy($image);
return $this->storeImage($stockImage, $scaledImage, $sizeName);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment