note 55987 added to function.imagejpeg
| From: | BramVanDam at osu1 dot php dot net | Date: | Fri, 19 Aug 2005 19:50:21 +0000 |
| Subject: | note 55987 added to function.imagejpeg | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-93924@lists.php.net to get a copy of this message | ||
If you wish to capture the jpg data into a variable, rather than outputting it or saving it into a
file (perhaps so you can put it in a database), you might want to consider output buffering.
Something along these lines should work:
<?php
ob_start(); // start a new output buffer
imagejpeg( $newimage, NULL, 100 );
$ImageData = ob_get_contents();
ob_end_clean; // stop this output buffer
?>
----
Manual Page -- http://www.php.net/manual/en/function.imagejpeg.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+55987
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+55987&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+55987&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+55987&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+55987&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+55987&report=yes&reason=non-english
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+55987&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+55987&report=yes
Search -- http://master.php.net/manage/user-notes.php