Gregwar / Image

A PHP library to handle images
MIT License
1k stars 191 forks source link

[PHP7] Undefined constant 'IMG_JPG' #83

Open soullivaneuh opened 9 years ago

soullivaneuh commented 9 years ago

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 commented 9 years ago

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.

Gregwar commented 9 years ago

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

madmis commented 9 years ago

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