note 112796 modified in function.imagejpeg by tularis
| From: | tularis@php.net | Date: | Mon, 16 Mar 2015 13:15:43 +0000 |
| Subject: | note 112796 modified in function.imagejpeg by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-201955@lists.php.net to get a copy of this message | ||
[[Editor's note: removed the header()-call since it is not required when outputting inline
image-data]]
One single code line, solve-me after 3 hours of blind search!
here is:
... ob_start();
imagejpeg( $img, NULL, 100 );
imagedestroy( $img );
$i = ob_get_clean();
echo "<img src='data:image/jpeg;base64," . base64_encode( $i
)."'>"; //saviour line!
--was--
One single code line, solve-me after 3 hours of blind search!
here is:
... ob_start();
header( "Content-type: image/jpeg" );
imagejpeg( $img, NULL, 100 );
imagedestroy( $img );
$i = ob_get_clean();
echo "<img src='data:image/jpeg;base64," . base64_encode( $i
)."'>"; //saviour line!
http://php.net/manual/en/function.imagejpeg.php