I am trying to take a user uploaded jpeg, convert it to a progressive jpg, and then upload it to my CDN (Cloudinary) in PHP.
I currently have the following code:
$data = file_get_contents($_FILES["file"]["tmp_name"]);
$img = imagecreatefromstring($data);
$prog = imageinterlace($img, 1);
$picinfo = \Cloudinary\Uploader::upload($prog);
I'm getting error, I think because $prog isn't a file anymore, but a created image. Is there any way to make the created image have a file path temporarily so it could be uploaded? How should I go about trying this?