1
0
Fork 0
forked from mirror/pixelfed

Update ImageUpdate job, skip non gd-compatible mime types from generating a thumbnail

This commit is contained in:
Daniel Supernault 2018-08-26 13:10:26 -06:00
parent 17e099c206
commit b0babe819d
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -43,9 +43,9 @@ class ImageUpdate implements ShouldQueue
$path = storage_path('app/'. $media->media_path);
$thumb = storage_path('app/'. $media->thumbnail_path);
try {
ImageOptimizer::optimize($thumb);
if(!in_array($media->mime, $this->protectedMimes))
{
ImageOptimizer::optimize($thumb);
ImageOptimizer::optimize($path);
}
} catch (Exception $e) {