mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-23 05:23:17 +00:00
Merge pull request #271 from dansup/frontend-ui-refactor
Update ImageOptimizePipeline, do not optimize gifs
This commit is contained in:
commit
51723d0ba2
2 changed files with 8 additions and 1 deletions
|
@ -38,7 +38,10 @@ 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')
|
||||||
|
{
|
||||||
ImageOptimizer::optimize($path);
|
ImageOptimizer::optimize($path);
|
||||||
|
}
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -103,6 +103,10 @@ class Image {
|
||||||
$ratio = $this->getAspectRatio($file, $thumbnail);
|
$ratio = $this->getAspectRatio($file, $thumbnail);
|
||||||
$aspect = $ratio['dimensions'];
|
$aspect = $ratio['dimensions'];
|
||||||
$orientation = $ratio['orientation'];
|
$orientation = $ratio['orientation'];
|
||||||
|
if($media->mime === 'image/gif' && !$thumbnail)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$img = Intervention::make($file)->orientate();
|
$img = Intervention::make($file)->orientate();
|
||||||
|
|
Loading…
Reference in a new issue