1

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?

Rick Bunch
  • 31
  • 1
  • 4
  • why don't you use an image manipulation plugin like phpthumb, however make sure that it is possible to convert to progressive using this plugin. Do some research and I am sure you will find the right one. – insanityCode Oct 15 '13 at 06:05

1 Answers1

-1

Figured it out. Turns out Cloudinary has a built in function for progressive jpg conversions!

Rick Bunch
  • 31
  • 1
  • 4
  • Your question is worded as a general case, but your "answer" is specific to Cloudinary. Please delete or rephrase your question. If you choose to reword your question, please complete your answer by providing the Cloudinary function you used. – Greg Perham Apr 28 '16 at 19:27