Whooops, right. HTML after or before picture data doesn't make any sense :)
I checked my a bit older function, which puts out image data correctly
working.
I'm sorry, but I didn't see a big difference to yours...

But as I said before: I don't know what your doing at that lines where you
wrote:
$im = imagecreatefromjpeg("./test.jpg");
Imagejpeg($im,'',20);
ImageDestroy($im);

If I was you, I would try to open and read a valid jpeg file, just for
testing, if the output works. If it works, I'd search the error in that
lines written above.

Here a snippet from my routine (and now I see: header really has to be
image/jpeg, I must have been a little tired):
require("../protected/php_db_access.inc");
mysql_select_db('mydb');
$picture_types=array("jpg" => "image/jpeg", "gif" => "image/gif", "png" =>
"image/png");
$result=mysql_query("SELECT type,picture FROM $table[pictures] WHERE
id='$pic_id'");
$img_data=mysql_fetch_array($result);
$mime=$picture_types[$img_data['type']];
$img_bin=$img_data['image'];
header("Content-type: $mime");
echo $image;


I know that the routine could be written better, but I think I wrote it in a
hurry when I wrote it :)
Perhaps you can do something with that routine (it works fine on a linux
machine)...

regards
stefan rusterholz

----- Original Message -----
From: "Hugh Danaher" <[EMAIL PROTECTED]>
To: "Stefan Rusterholz" <[EMAIL PROTECTED]>
Cc: "Php-General" <[EMAIL PROTECTED]>
Sent: Tuesday, September 25, 2001 9:33 AM
Subject: Re: [PHP] imageJPEG problem.


> Stephan,
> Check that there are no html statements or blank lines above the <?php
line.
> I had a few blank lines in my first program, and it gave me the same error
> message.
> Hugh
>
>
> ----- Original Message -----
> From: Stefan Rusterholz <[EMAIL PROTECTED]>
> To: Johan Vikerskog (EMP) <[EMAIL PROTECTED]>;
> <[EMAIL PROTECTED]>
> Sent: Tuesday, September 25, 2001 12:13 AM
> Subject: Re: [PHP] imageJPEG problem.
>
>
> >
> > ----- Original Message -----
> > From: "Johan Vikerskog (EMP)" <[EMAIL PROTECTED]>
> > To: "'Stefan Rusterholz'" <[EMAIL PROTECTED]>; "Johan Vikerskog
> (EMP)"
> > <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> > Sent: Tuesday, September 25, 2001 9:07 AM
> > Subject: RE: [PHP] imageJPEG problem.
> >
> >
> > > Thanks for your answer but the problem remains.
> > > It says i allready have given the header information and everything
> comes
> > out in ascii.
> > >
> > > file://Johan
> > >
> > > -----Original Message-----
> > > From: Stefan Rusterholz [mailto:[EMAIL PROTECTED]]
> > > Sent: den 25 september 2001 08:55
> > > To: Johan Vikerskog (EMP); [EMAIL PROTECTED]
> > > Subject: Re: [PHP] imageJPEG problem.
> > >
> > >
> > > ----- Original Message -----
> > > From: "Johan Vikerskog (EMP)" <[EMAIL PROTECTED]>
> > > To: <[EMAIL PROTECTED]>
> > > Sent: Tuesday, September 25, 2001 8:47 AM
> > > Subject: [PHP] imageJPEG problem.
> > >
> > >
> > > > When trying to use a simple code like this below i receive an error
> > which
> > > says that it cant find the header.
> > > >
> > > > <?
> > > > Header("Content-type: image/jpeg");
> > >
> > > I don't know about the other stuff of your script, but when I wrote a
> > > similar script, I took "content-type: image/jpg" and not 'jpeg'.
> > > Probably that's the point...
> > >
> > > > $im = imagecreatefromjpeg("./test.jpg");
> > > > Imagejpeg($im,'',20);
> > > > ImageDestroy($im);
> > > > ?>
> > > >
> > > > It outputs the information in ascii and binary code. it doesn't show
> the
> > > picture
> > > >
> > > > Thanks for all the help you can give me.
> > > > file://Johan
> > > >
> > > > --
> > > > PHP General Mailing List (http://www.php.net/)
> > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > > To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
> >
> > make sure you run the php-part at the very top of the file:
> > <?php
> >     header(...);
> > ?>
> > <HTML>
> > <HEAD>
> > ...and so on
> >
> >
> > if you have output before you execute the php part, your webserver will
> > generate the header for you and then it is impossible to send another
> header
> > (exactly because of what the warning tells you: the headers are already
> > sent - but by the server and not by you and the server normally assumes
> > text/html or text/plain).
> >
> >  I hope, it helps
> >  regards
> >
> >  Stefan Rusterholz
> >
> >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to