I have a file upload class which returns an image resize object if the file upload is believed to be an image. The construct of the image resize class starts with this:
$this->resource = imagecreatefromstring($this->getData());
if (!is_resource($this->resource)) {
return $this->error(IMAGE_ERR_SOURCE_CREATION_ERROR);
}
$this->getData()
returns the string returned from file_get_contents from tmp_name
from $_FILES[..]
array.
The promlem is as follows. It works perfectly fine on my development server 5.3.0
but imagecreatefromstring()
fails on the production server, 5.3.5
.
Why? I cannot get my head around it, I have compared strings of images from development and product using base64 and they are identical. What do I need to look at thats changed from .0
to .5
?
Edit: Yes, GD2 is installed and working correctly. Incidentally, WordPress (3.1) is also installed on this server and all image functionality is working correctly, which is also why I am so puzzled.
Edit 2
After debugging with display_errors (I know should have done this first), the error returned is:
Warning: imagecreatefromstring(): No JPEG support in this PHP build
Does this mean I have to reinstall GD with JPEG support or can it be enabled once installed, IE now?