Intervention / Intervention/image

Imagick driver writes white image after resize

Open
#1,261 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

investigation-needed patch-release
Dominant language
PHP
Stars
14.4k
Forks
1.5k
Avg merge
17h 51m
Merged PRs (30d)
11

Description

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

\Intervention\Image\ImageManager::imagick()->read('st-john-xl.jpg')->save('st-john2.jpg');

Environment (please complete the following information):

  • PHP Version: 8.2.13
  • OS: Docker (PHP-FPM)
  • Intervention Image Version: 3.2.3
  • Imagick 3.7.0 / ImageMagick 6.9.11-60 Q16 x86_64 2021-01-25

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with the provided Intervention Image PHP snippet and the linked JPEG under the reported PHP, Imagick, and ImageMagick versions. Compare the Imagick result with direct Imagick and the GD driver; done means saving the image no longer produces a white output while preserving the source content.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
computer-graphics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.