Skip to content

Commit

Permalink
#447 Fix for animated gif upload. (Treat "gif" and "svg" as normal fi…
Browse files Browse the repository at this point in the history
…les) / Image quality should remain 100% by default.
  • Loading branch information
youchenlee committed Oct 20, 2017
1 parent d214e13 commit 13abe4d
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/controllers/UploadController.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,19 +66,17 @@ private function proceedSingleUpload($file)

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

// Generate a thumbnail
if (parent::imageShouldHaveThumb($file)) {
$this->makeThumb($new_filename);
}
} else {
// File is not an image
// Create (move) the file
File::move($file->getRealPath(), $new_file_path);
}
Expand Down

0 comments on commit 13abe4d

Please sign in to comment.