Skip to content

Commit 8a63133

Browse files
authored
Merge pull request #6 from Didldu-Florian/master
Exif rotation fix and imagecopyresampled
2 parents 8d5fe09 + 94ffc69 commit 8a63133

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

library/imgcopyresized.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,15 +154,15 @@ public function generateThumbnail($file = array(), $savepath = "/")
154154
$new_Y = $final_height;
155155
$new_X = floor($final_height * ($org_X / $org_Y)); // Resize based on height
156156
$dst_image = imagecreatetruecolor($new_X, $new_Y);
157-
imagecopyresized($dst_image, $src_image, 0, 0, 0, 0, $new_X, $new_Y, $org_X, $org_Y);
157+
imagecopyresampled($dst_image, $src_image, 0, 0, 0, 0, $new_X, $new_Y, $org_X, $org_Y);
158158
}
159159
else
160160
{
161161
// height is heigher than x:y
162162
$new_X = $final_width;
163163
$new_Y = floor($final_width * ($org_Y / $org_X)); // Resize based on width
164164
$dst_image = imagecreatetruecolor($new_X, $new_Y);
165-
imagecopyresized($dst_image, $src_image, 0, 0, 0, 0, $new_X, $new_Y, $org_X, $org_Y);
165+
imagecopyresampled($dst_image, $src_image, 0, 0, 0, 0, $new_X, $new_Y, $org_X, $org_Y);
166166
}
167167
}
168168

0 commit comments

Comments
 (0)