is there a way that i can use createimagefromjpeg() to save an image from a url but allow all image file types?
It seems obvious that createimagefromjpeg only allows jpeg / jpg.
Here is my current process:
// create the image and save it
$imagefile = iageURL;
$resource = imagecreatefromjpeg($imagefile);
// X amount of quality is the last number
imagejpeg($resource, "images/covers/imagename.jpeg", 50);
imagedestroy($resource);
This works great because it allows me to reduce the image quality. But i get an error when trying to use anything other than a jpeg / jpg.
Is there a way around this? Or perhaps a better method of saving images (at a reduced quality) from a url.
Craig.