Skip to content

Commit cd29ab0

Browse files
author
FreedomKnight
committed
only rotated image should resave again
1 parent ad17f65 commit cd29ab0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/FileApi.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,19 +204,20 @@ private function setTmpImage($upload_file)
204204
switch ($exif['Orientation']) {
205205
case 8:
206206
$img = imagerotate($img, 90, 0);
207+
imagepng($img, $upload_file->getRealPath());
207208
break;
208209
case 3:
209210
$img = imagerotate($img, 180, 0);
211+
imagepng($img, $upload_file->getRealPath());
210212
break;
211213
case 6:
212214
$img = imagerotate($img, -90, 0);
215+
imagepng($img, $upload_file->getRealPath());
213216
break;
214217
}
215218
}
216219
}
217220

218-
imagepng($img, $upload_file->getRealPath());
219-
220221
return $img;
221222
} else {
222223
return null;

0 commit comments

Comments
 (0)