Image icon indicating copy to clipboard operation
Image copied to clipboard

[PHP7] Undefined constant 'IMG_JPG'

Open soullivaneuh opened this issue 9 years ago • 3 comments

When I try to run my application on php7, I got this error on runtime image rendering:

Fatal error: Undefined constant 'IMG_JPG'
500 Internal Server Error - FatalThrowableError

1. in vendor/gregwar/image/Gregwar/Image/Image.php at line 285
2. at Image ->setAdapter ('gd') 
in vendor/gregwar/image/Gregwar/Image/Image.php at line 269
...

soullivaneuh avatar Aug 02 '15 06:08 soullivaneuh

Have to test, but I think this is because my PHP version is possibly not compiled with GD.

http://php.net/manual/fr/function.imagetypes.php

BTW, a proper error throw by the library would be better like "GD library is not installed" in this case.

soullivaneuh avatar Aug 02 '15 06:08 soullivaneuh

You can clearly see that in the phpinfo Do not hesitate to open a pr for gd checking

Gregwar avatar Aug 02 '15 15:08 Gregwar

I have the same bug on php 7 without gd. After compile and enable gd - all worked fine.

madmis avatar Sep 28 '15 08:09 madmis