craftcms / craftcms/cms

[4.x]: Image 'does not appear to be an image'

Open
#15,782 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug craft4 need more info
Dominant language
PHP
Stars
3.6k
Forks
705
Avg merge
1d 5h
Merged PRs (30d)
134

Description

What happened?
Description

Some of our user supplied images are throwing an error in Sentry.io, stating that the image does not have any dimensions (Asset xxxxx is missing its width or height). The image attached in an example. The erroring images tend to be large, this one being 20mb, 300dpi, 8256x5504. JPEG.

If you try to edit the image in the editor (crop, flip etc) it fails when saving.

CleanShot 2024-09-23 at 13 40 57@2x

Original image: https://ibb.co/FgtvBLy

Is it due to the size, or something in the image itself, meta, color profile etc?

Craft CMS version

4.10.8

PHP version

8.2.21

Operating system and version

No response

Database type and version

No response

Image driver and version

Imagick 3.7.0 (ImageMagick 7.1.1-32)

Installed plugins and versions

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 failure with the linked 20MB JPEG on Craft CMS 4.10.8 using PHP 8.2.21, Imagick 3.7.0, and ImageMagick 7.1.1-32. Compare image-dimension detection with the reported image properties and determine what behavior should allow editing to complete successfully.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.