Re: imagejpeg function output
| From: | DvDmanDT | Date: | Fri, 29 Aug 2003 17:51:47 +0000 |
| Subject: | Re: imagejpeg function output | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-161179@lists.php.net to get a copy of this message | ||
Well, at the page where you want to show the image, you must type like <img
src="generate_image.php">, and then in generate_image.php, you have the
image generation code...
--
// DvDmanDT
MSN: dvdmandt@hotmail.com
Mail: dvdmandt@telia.com
"Mike At Spy" <spycobalt@spyproductions.com> skrev i meddelandet
news:GKEFLEHIPEGIFEECKBNEMEOGMCAA.spycobalt@spyproductions.com...
>
> Hmmmm....yeah, but since this is with a page, I keep getting the 'error,
> headers already sent' thing. How do I get past that?
>
> :)
>
> Thanks for your help!
>
> -Mike
>
>
> > -----Original Message-----
> > From: Marek Kilimajer [mailto:kilimajer@webglobe.sk]
> > Sent: Friday, August 29, 2003 12:51 PM
> > To: Mike At Spy
> > Cc: php-general@lists.php.net
> > Subject: Re: [PHP] imagejpeg function output
> >
> >
> > You need to send the right header, in this case
> > header('Content-type: image/jpg');
> >
> > Mike At Spy wrote:
> > > Just to make sure no one is lead astray - I still have an issue
> > getting jpeg
> > > enabled on a server with gd and php. I am asking this question
> > 'cause I am
> > > doing some work on a different server where jpeg is enabled.
> > >
> > > Anyway, I have this sort of setup:
> > >
> > > $src_img = imagecreatefromjpeg($rand_image);
> > > $dst_img = imagecreate($destWidth,$destHeight);
> > > imagecopyresized($dst_img, $src_img, 0, 0, 0, 0,
> > $destWidth,$destHeight,
> > > $srcWidth, $srcHeight);
> > > imageJPEG($dst_img, $dest_file, 100);
> > > imagedestroy($src_img);
> > >
> > > print $dest_file;
> > >
> > > Now, from this I get a bunch of binary code like:
> > >
> > >
ª¸âq¼Öa µ*'ì ªNp䤡 r«V
> > >
> >
ΦܿGà¾Çq¿å¼=©4±3u18º÷xj4ê%R£¥N¥Jj6ý8FMN½Z~Öt©}bµdøûvjZ
> > `ð÷Á¿Þ.ø
> > > eg3%ïÄ?CágÃKYûNÕ
> > >
> > > Which I sort of expected.
> > >
> > > BUT; how do I show the picture ($dest_file) in the browser from here?
> > >
> > > Thanks,
> > >
> > > -Mike
> > >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >