mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-01 18:53:16 +00:00
Update ImageUpdate job, skip non gd-compatible mime types
This commit is contained in:
parent
c52c841eac
commit
17e099c206
1 changed files with 7 additions and 1 deletions
|
@ -16,6 +16,12 @@ class ImageUpdate implements ShouldQueue
|
||||||
|
|
||||||
protected $media;
|
protected $media;
|
||||||
|
|
||||||
|
protected $protectedMimes = [
|
||||||
|
'image/gif',
|
||||||
|
'image/bmp',
|
||||||
|
'video/mp4'
|
||||||
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new job instance.
|
* Create a new job instance.
|
||||||
*
|
*
|
||||||
|
@ -38,7 +44,7 @@ class ImageUpdate implements ShouldQueue
|
||||||
$thumb = storage_path('app/'. $media->thumbnail_path);
|
$thumb = storage_path('app/'. $media->thumbnail_path);
|
||||||
try {
|
try {
|
||||||
ImageOptimizer::optimize($thumb);
|
ImageOptimizer::optimize($thumb);
|
||||||
if($media->mime !== 'image/gif')
|
if(!in_array($media->mime, $this->protectedMimes))
|
||||||
{
|
{
|
||||||
ImageOptimizer::optimize($path);
|
ImageOptimizer::optimize($path);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue