I\'m resizing images with php gd. The result is image resources that i want to upload to Amazon S3. It works great if i store the images on disk first but i would like to up
I can't write on php://memory with imagepng, so I use ob_start(), ob_get_content() end ob_end_clean()
$image = imagecreatefrompng('./image.png'); //load image
// do your processing here
//...
//...
//...
ob_start(); //Turn on output buffering
imagejpeg($image); //Generate your image
$output = ob_get_contents(); // get the image as a string in a variable
ob_end_clean(); //Turn off output buffering and clean it
echo strlen($output); //size in bytes