Unable to read image from path error - imagemagick decoder bug


Network license
License owner
▶ Reproduction steps
  1. Upload an image larger than 17MB
  2. It will throw 500 internal server error
😢 Unexpected result

Any image bigger than 17MB with resolution large enough throw internal server error because of a bug in imagemagick decoder code of chevereto. I might be wrong.


Why I say specifically 17MB?
Because I tested upload with an increment of 1MB images. even 16.8MB image was uploaded without error.
I could replicate it on demo as well.


Here are the sample images that you can test.
16.8mb image - This will be uploaded without error
17+mb image - This will throw error.

To be fair, I think it is related to resolution than actual image size. I am not sure.
It is weekday, so I couldn't check the codes. Even if I did I am sure I will be drowned in over information.

You can try your own images as well. Anything larger than 17MB with unusual resolution.

I tested it on stable release. All images I tested were successfully updated. So, this bug is present on beta.

📃 Error log message

Fatal error [0]: Unable to read image from path (/var/www/domain/tmp/Ie6pGr.jpg).
Triggered in /app/vendor/intervention/image/src/Intervention/Image/Imagick/Decoder.php:29

Stack trace:
#0 /app/vendor/intervention/image/src/Intervention/Image/AbstractDecoder.php(339): Intervention\Image\Imagick\Decoder->initFromPath()
#1 /app/vendor/intervention/image/src/Intervention/Image/AbstractDriver.php(66): Intervention\Image\AbstractDecoder->init()
#2 /app/vendor/intervention/image/src/Intervention/Image/ImageManager.php(54): Intervention\Image\AbstractDriver->init()
#3 /app/vendor/intervention/image/src/Intervention/Image/ImageManagerStatic.php(58): Intervention\Image\ImageManager->make()
#4 /app/lib/classes/class.imageresize.php(41): Intervention\Image\ImageManagerStatic::make()
#5 /app/lib/classes/class.image.php(999): CHV\Imageresize->setSource()
#6 /app/lib/classes/class.image.php(690)" while reading response header from upstream, client:, server: domain.com, request: "POST /json HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.4-fpm-domain.sock:", host: "domain.com", referrer: "https://domain.com/upload"
Last edited: