Gregwar / Image

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

Undefined constant 'IMG_JPG' #108

Closed hizt closed 8 years ago

hizt commented 8 years ago

Undefined constant 'IMG_JPG' FILE: vendor/gregwar/image/Gregwar/Image/Image.php  LINE: 285

when php uninstall "GD" extension , but "Imagick" installed

soullivaneuh commented 8 years ago

You just closed the issue. Maybe can you explain how did you solve it?

hizt commented 8 years ago

install "GD" extension for php

soullivaneuh commented 8 years ago

@Gregwar Maybe we can add a prevent error message for missing gd-extension library.

Gregwar commented 8 years ago

Actually, I was hoping this (https://github.com/Gregwar/Image/blob/master/composer.json#L16) would do the job

The problem is that these constants are in static initialization: https://github.com/Gregwar/Image/blob/master/Adapter/GD.php#L10

A solution would be defaulting it to null and populating it in the constructor (where the gd check and exception already exists)