Drunklord
10-08-2012, 03:58 PM
Hi all! Using PHP 5.3.1 con Apache 2.2.21 I can not run this
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
<head>
<title>Draw image with gd</title>
</head>
<body>
<?php
Header("Content-type: image/jpeg");
$im = @imagecreatefromjpeg(“myImage”);
Imagejpeg($im);
ImageDestroy($im);
?>
</body>
</html>
The error message indicates: “can not show the image http://localhost/clipped_image.php , it contains errors”
When I borrow this line
Header("Content-type: image/jpeg");
The page shows char equivalent of the image file's bytes. So, I think that putting in Header("Content-type: image/jpeg"); creates a problem, but why?
Anyone can help me, please?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
<head>
<title>Draw image with gd</title>
</head>
<body>
<?php
Header("Content-type: image/jpeg");
$im = @imagecreatefromjpeg(“myImage”);
Imagejpeg($im);
ImageDestroy($im);
?>
</body>
</html>
The error message indicates: “can not show the image http://localhost/clipped_image.php , it contains errors”
When I borrow this line
Header("Content-type: image/jpeg");
The page shows char equivalent of the image file's bytes. So, I think that putting in Header("Content-type: image/jpeg"); creates a problem, but why?
Anyone can help me, please?