contao / core-bundle

[READ-ONLY] Contao Core Bundle
GNU Lesser General Public License v3.0
122 stars 57 forks source link

"Broken image!" when uploading jpg #1623

Closed internetinnovations closed 6 years ago

internetinnovations commented 6 years ago

We have heavy issues with a new project: When jpg pictures are uploaded, they are shown as broken in the backoffice. In the frontend they are shown and work flawlessly.

Error when trying to open a CE via BO with a broken image: screenshot_unable-to-open

File Manager: screenshot_broken-image

All other picture file types also work. Error log shows: Image "path/picture.jpg" could not be processed: Unable to open image /var/www/project_folder/files/img/picture.jpg

This project uses: Contao Version 4.4.20

ausi commented 6 years ago

Can you provide us one of the JPEG images so that we can have a closer look?

xchs commented 6 years ago

Check the PHP information (phpinfo()) which image libraries (GD, Imagick or Gmagick) are available and if the JPEG support is enabled.

YenRinkleff commented 6 years ago

okay, checked phpinfo() and saw, that gd hasn't jpeg support enabled... Have to look now, how to activate it...

internetinnovations commented 6 years ago

It might be useful to update the error log message to include a reference to the image libraries as @xchs posted. Thanks for the info btw.

akroii commented 6 years ago

Same here. My logs are:

[2018-10-11 15:48:57] security.INFO: Attempting SimplePreAuthentication. {"key":"frontend","authenticator":"Contao\\CoreBundle\\Security\\ContaoAuthenticator"} []
[2018-10-11 15:48:57] app.CRITICAL: An exception occurred. {"exception":"[object] (Imagine\\Exception\\RuntimeException(code: 445): Crop operation failed at /var/www/web29855652/html/contao4/vendor/imagine/imagine/lib/Imagine/Imagick/Image.php:146, ImagickException(code: 445): unable to open pixel cache `/var/www/web29855652/html/contao4/assets/images/5/yyyy-flotte-e4c6fdd7.jpg': No such file or directory @ error/cache.c/OpenPixelCache/3673 at /var/www/web29855652/html/contao4/vendor/imagine/imagine/lib/Imagine/Imagick/Image.php:141)"} []

PHP 7.1.14 Contao 4.4.23 bildschirmfoto 2018-10-11 um 15 50 59

bildschirmfoto 2018-10-11 um 15 51 06

akroii commented 6 years ago

Es schient, als wäre die PHP Version nicht mit der dazugehörigen GraphicsMagick-Version kompatibel. Versucht, entweder die PHP Version runterzustellen, oder GraphicsMagick-Version zu ändern.

sixtyniner-official commented 5 years ago

I had same problem on Mittwald hosting with Contao 4.6.6 and PHP7.2-FPM, after switching to PHP7.2-CGI, problem was solved.

fritzmg commented 5 years ago

Mittwald is claiming, that Imagick is not compatible with PHP-FPM in general. However, I couldn't find any evidence that this is true. I think that something in their setup is wrong.

ausi commented 5 years ago

There seem to be issues with Imagick if you use PHP-FPM and chrooting, but that should be fixable: https://www.ateamsystems.com/tech-blog/imagemagick-under-php-fpm-and-chroot/

fritzmg commented 5 years ago

I see, then someone should tell that to Mittwald probably 😁