I have some code that downloads an image from a remote server
$data = file_get_contents("$rURL");
I want to then change the quality of this image, but do not want to save it out to a file first, how do I convert $data into an image that I can then use in imagecopyresampled?
Thanks
Try
imagecreatefromstring— Create a new image from the image stream in the stringExample from PHP manual:
As an alternative use any of the
imagecreatefrom*functions if you know the image format in advance to load the URL directly, e.g.