Skip to content

Commit 3ac9336

Browse files
committed
fix gif compress will lose frame
1 parent e4e9bdd commit 3ac9336

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/FileApi.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,16 +193,14 @@ private function setTmpImage($upload_file)
193193
{
194194
$image_types = array('image/png', 'image/gif', 'image/jpeg', 'image/jpg');
195195
$image_path = $upload_file instanceof UploadedFile ? $upload_file->getRealPath() : $upload_file;
196+
$img = null;
196197

197198
if (in_array(\File::mimeType($upload_file), $image_types)) {
198199
switch (\File::mimeType($upload_file)) {
199200
case 'image/png':
200201
$img = imagecreatefrompng($image_path);
201202
break;
202203
case 'image/gif':
203-
$img = imagecreatefromgif($image_path);
204-
imagegif($img, $image_path);
205-
break;
206204
case 'image/jpeg':
207205
case 'image/jpg':
208206
default:

0 commit comments

Comments
 (0)