mirror of
https://github.com/friendica/friendica
synced 2025-04-24 10:30:11 +00:00
Fix unhandled image detection
This commit is contained in:
parent
14e5b06029
commit
1069cfb570
4 changed files with 21 additions and 6 deletions
|
@ -207,13 +207,13 @@ class Photo extends BaseApi
|
|||
$mimetype = $img->getType();
|
||||
}
|
||||
|
||||
// if customsize is set and image is not a gif, resize it
|
||||
if ($photo['type'] !== image_type_to_mime_type(IMAGETYPE_GIF) && $customsize > 0 && $customsize <= Proxy::PIXEL_THUMB && $square_resize) {
|
||||
// if customsize is set and image resizing is supported for this image, resize it
|
||||
if (Images::canResize($photo['type']) && $customsize > 0 && $customsize <= Proxy::PIXEL_THUMB && $square_resize) {
|
||||
$img = new Image($imgdata, $photo['type'], $photo['filename']);
|
||||
$img->scaleToSquare($customsize);
|
||||
$imgdata = $img->asString();
|
||||
$mimetype = $img->getType();
|
||||
} elseif ($photo['type'] !== image_type_to_mime_type(IMAGETYPE_GIF) && $customsize > 0) {
|
||||
} elseif (Images::canResize($photo['type']) && $customsize > 0) {
|
||||
$img = new Image($imgdata, $photo['type'], $photo['filename']);
|
||||
$img->scaleDown($customsize);
|
||||
$imgdata = $img->asString();
|
||||
|
|
|
@ -106,8 +106,8 @@ class Proxy extends BaseModule
|
|||
// stop.
|
||||
}
|
||||
|
||||
// reduce quality - if it isn't a GIF
|
||||
if ($image->getImageType() != IMAGETYPE_GIF) {
|
||||
// reduce quality - if it is supported for this image type
|
||||
if (Images::canResize($image->getType())) {
|
||||
$image->scaleDown($request['size']);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue