Closed btamas86 closed 4 months ago
Describe the bug I use the "cover" type of resizing and I noticed that if the original image is odd in size, the resizing is incorrect.
Original image size: 375x250 Requested size: 240x90 Received size: 239x90
So it is rounded down, not up, which I think is a problem.
Code Example
$imageContent = file_get_contents('image.jpg'); $image = (new Intervention\Image\ImageManager(new Intervention\Image\Drivers\Gd\Driver))->read($imageContent); $image->cover(240, 90, 'center'); $imgEncoded = $image->encodeByMediaType(quality: 85); response((string)$imgEncoded) ->withHeaders([ 'Content-type' => $imgEncoded->mediaType(), ]);
Images Original: Resized:
Environment (please complete the following information):
Thanks for reporting. Yes, I can confirm the bug. Unfortunately it happens with GD and Imagick. I will look into it.
Thank you very much!
This is now fixed in 3.6.5.
3.6.5
Describe the bug I use the "cover" type of resizing and I noticed that if the original image is odd in size, the resizing is incorrect.
Original image size: 375x250 Requested size: 240x90 Received size: 239x90
So it is rounded down, not up, which I think is a problem.
Code Example
Images Original: Resized:
Environment (please complete the following information):