GD - Output image from file! - imagejpeg() Take 2

GD - Output image from file! - imagejpeg() Take 2

am 02.05.2005 23:20:56 von hafsteinngretars

Sorry for reposting, got an error message when I tryed the same
thread:
Unable to retrieve message
d55dsk$cdl$1@nwrdmz01.dmz.ncs.ea.ibs-infra.bt.com
-----------------------------------------------

Anyways...
This is my code and there is nothing else in that php page.

header("Content-Type: image/jpeg");
$MyImage = "image.jpg"; // The image is in the same directory as the
php page.

$im = @imagecreatefromjpeg($MyImage);
imagejpeg($im);
?>

It does not work! (trying to output jpeg file to browser)
Error message:
Warning: Cannot modify header information - headers already sent by
(output started at C:\htdocs\MyWeb\TMP20u23fvshk.php:9) in
C:\htdocs\MyWeb\TMP20u23fvshk.php on line 10

end then the same stuff:
ÿØÿàJFIFÿþ>CREATOR: gd-jpeg v1.0 (using IJG JPEG v62), default
quality ÿÛC    $.'
",#(7),01444'9=82<.342ÿÛC 
2!!22222222222222222222222222222222222222222222222222ÿÀ2 ª"

any suggestions!!! Any help would be great!

regards, Haffi

Re: GD - Output image from file! - imagejpeg() Take 2

am 03.05.2005 08:37:27 von Andrew

In news:da318fcd.0505021320.18989fd2@posting.google.com,
Haffi wrote:
> Sorry for reposting, got an error message when I tryed the same
> thread:
> Unable to retrieve message
> d55dsk$cdl$1@nwrdmz01.dmz.ncs.ea.ibs-infra.bt.com
> -----------------------------------------------
>
> Anyways...
> This is my code and there is nothing else in that php page.
>
> > header("Content-Type: image/jpeg");
> $MyImage = "image.jpg"; // The image is in the same directory as the
> php page.
>
> $im = @imagecreatefromjpeg($MyImage);
> imagejpeg($im);
>>
>
> It does not work! (trying to output jpeg file to browser)
> Error message:
> Warning: Cannot modify header information - headers already sent by
> (output started at C:\htdocs\MyWeb\TMP20u23fvshk.php:9) in
> C:\htdocs\MyWeb\TMP20u23fvshk.php on line 10
>
> end then the same stuff:
> ÿØÿàJFIFÿþ>CREATOR: gd-jpeg v1.0 (using IJG JPEG v62), default
> quality ÿÛC    $.'
> ",#(7),01444'9=82<.342ÿÛC 
> 2!!22222222222222222222222222222222222222222222222222ÿÀ2 ª"
>
> any suggestions!!! Any help would be great!
>
> regards, Haffi

Just tested your code (had to stick a '?' in your closing tag) and it works
fine. I'd say that you have a space or other character before your opening
'

--
Andrew @ Rockface
np: (Winamp is not active ;-)
www.rockface-records.co.uk