Closed alexweb-zz closed 9 years ago
Ok, I found the reason. The problem was not in your library. Before saving image I fix image orientation using this method (it rotates image according to EXIF data):
public static function fixImageOrientation(UploadedFile $file)
{
if(!empty($file->tempName)
&& exif_imagetype($file->tempName) == IMAGETYPE_JPEG){
$image = imagecreatefromjpeg($file->tempName);
$image = imagerotate($image, array_values([0, 0, 0, 180, 0, 0, -90, 0, 90])[@exif_read_data($file->tempName)['Orientation'] ?: 0], 0);
imagejpeg($image, $file->tempName);
}
}
And that method adds these strips...
When I'm resizing image some strange black borders appear on thumbnail. My code is:
Original image:
Final image:
Please check top and bottom borders. Do you know why does it happen?