Skip to content

Commit 13abe4d

Browse files
committed
#447 Fix for animated gif upload. (Treat "gif" and "svg" as normal files) / Image quality should remain 100% by default.
1 parent d214e13 commit 13abe4d

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/controllers/UploadController.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,19 +66,17 @@ private function proceedSingleUpload($file)
6666

6767
event(new ImageIsUploading($new_file_path));
6868
try {
69-
if (parent::fileIsImage($file)) {
70-
// File is an image
71-
// Process & compress the image
69+
if (parent::fileIsImage($file) && !in_array($file->getMimeType(), ['image/gif', 'image/svg+xml'])) {
70+
// Handle image rotation
7271
Image::make($file->getRealPath())
7372
->orientate() //Apply orientation from exif data
74-
->save($new_file_path, 90);
73+
->save($new_file_path);
7574

7675
// Generate a thumbnail
7776
if (parent::imageShouldHaveThumb($file)) {
7877
$this->makeThumb($new_filename);
7978
}
8079
} else {
81-
// File is not an image
8280
// Create (move) the file
8381
File::move($file->getRealPath(), $new_file_path);
8482
}

0 commit comments

Comments
 (0)