
Originally Posted by
Little Goat
PHP Code:
<?php
$im = @imagecreatefromstring(file_get_contents('image.jpg'));
imagejpeg($im);
header ("Content-type: image/jpg");
?>
You have the order a bit wrong; the header needs to be sent before the image:
PHP Code:
<?php
header ('Content-Type: image/jpg');
imagejpeg(imagecreatefromstring(file_get_contents('image.jpg')), null,100);
?>
But all this is pretty pointless apart from being a learning exercise because nothing is actually being done with the image itself.
Bookmarks