-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Imagick driver writes white image after resize #1261
Comments
After some more digging, this problem doesn't occur when removing line The The question now is, is this a InterventionImage bug, or an Imagick bug. Or is the image corrupt... A possible fix could be to replace line 32, but I cannot oversee if this would break stuff. I did a quick test resizing an animated GIF and the image mentioned in the start post. $imagickCoalesced = $imagick->coalesceImages();
if ($imagickCoalesced->count() !== $imagick->count()) {
$imagick = $imagickCoalesced;
} |
That's strange. I just checked it with the image from the URL in my environment and could not reproduce the problem described. Everything okImageManager::imagick()
->read('images/st-john-xl.jpg')
->resize(300, 200)
->save('images/st-john-xl-2.jpg'); PHP: 8.2.14 |
I checked it again on Debian. Here I can see the effect with the white background. Unfortunately, that doesn't get me any further at the moment. Bug reproducablePHP: 8.1.26 Bug reproducablePHP: 8.2.14 |
Thanks Oliver for checking. I updated my previous message, because I missed your reply:
Basically this checks if coalesceImages() does anything. If not, continue working with the original. |
After further tests, I currently see no other possibility than to call Although I cannot understand the logic of this error at all. It could very well be a bug in ImageMagick. This could even be fixed with ImageMagick >= 7.1.1-24, as no error occurred with this version in my tests. However, this is just speculation and would have to be checked. |
This issue should be kept in mind. The described bug was only fixed with a workaround and a more permanent solution should be sought. |
Describe the bug
I have a large JPEG file which results in a white output file (with correct dimensions) after resizing. If I use Imagick directly from within PHP it works correctly (at least with the
thumbnailImage
method). Also when using the GD-driver, the results are as expected.After more fiddling, even leaving the resize call out of it, results in a white image, see code sample below.
Code Example
Expected behavior
I expect the st-john2.jpg to have the same file size and content. Instead the original is ~25MB and the new version ~180kB
Images
I can provide the image using PB, due to copyright.
EDIT
This image has the same behaviour: http://pictures.4ever.eu/data/download/buildings/bridges/st-johns-bridge,-forest,-hill-245439.jpg?no-logo
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: