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 $protectedMimes = [
|
||||
'image/gif',
|
||||
'image/bmp',
|
||||
'video/mp4'
|
||||
];
|
||||
|
||||
/**
|
||||
* Create a new job instance.
|
||||
*
|
||||
|
@ -38,7 +44,7 @@ class ImageUpdate implements ShouldQueue
|
|||
$thumb = storage_path('app/'. $media->thumbnail_path);
|
||||
try {
|
||||
ImageOptimizer::optimize($thumb);
|
||||
if($media->mime !== 'image/gif')
|
||||
if(!in_array($media->mime, $this->protectedMimes))
|
||||
{
|
||||
ImageOptimizer::optimize($path);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue