Re: Size of images (in bytes)
| From: | Marek Kilimajer | Date: | Thu, 23 Jan 2003 16:50:43 +0000 |
| Subject: | Re: Size of images (in bytes) | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-132864@lists.php.net to get a copy of this message | ||
Use output buffer:
ob_start();
ImageJPEG($im);
$imagestring=ob_get_contents();
ob_end_clean();
Oliver Witt wrote:
"1lt John W. Holmes" schrieb:After calling the funtion ImageCreateFromJPEG like this: $im = ImageCreateFromJPEG(pic.jpg); then $im is not a string but a resource. I don't know how to get it into a string.... OlliAfter calling to the function ImageCreateFromJPEG() and before outputing the image with ImageJPEG, is there a way to determine the images size in bytes? I want to reduce the quality more and more until it has reached a certain level. Thanks, OlliYou have the image data in a string, right? Could you relate the length of that string to the resulting size of the file, somehow? ---John Holmes...