Re: imagejpeg

From: Date: Wed, 12 Nov 2003 15:17:00 +0000
Subject: Re: imagejpeg
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-169277@lists.php.net to get a copy of this message
Thanks. This is exactly what I needed. Never save the file, just put it into the db. egil ----- Original Message ----- From: "Jason Wong" <php-general@gremlins.biz> Newsgroups: php.general To: <php-general@lists.php.net> Sent: Wednesday, November 12, 2003 9:17 AM Subject: Re: [PHP] imagejpeg > On Wednesday 12 November 2003 00:34, Egil Berntsen wrote: > > My site need to create some images on-the-fly(with user data) for every > > user but I have some problem with the creating of the jpeg-image. I put > > these images in my MySQL database for later use. This have to do somthing > > with write protection because this is not a problem when I'm working on > > localhost. The problem comes on .com. > > > > I'm trying this: > > $image = imagecreate(100,100); > > {some drawing} > > $fname="filename.jpg"; > > ImageJPEG($image, $fname); > > {database} > > ImageDestroy($image); > > unlink($filename); > > > > And get this: > > Warning: imagejpeg(): Unable to open 'filename.jpg' for writing in ... > > If you're going to be storing it in the DB then there's no need to write to a > file first. Use the output buffer controls (manual > Output Control > Functions) to capture the output of imagejpeg($image) and insert into the DB > (after appropriate sanitation). > > -- > Jason Wong -> Gremlins Associates -> www.gremlins.biz > Open Source Software Systems Integrators > * Web Design & Hosting * Internet & Intranet Applications Development * > ------------------------------------------ > Search the list archives before you post > http://marc.theaimsgroup.com/?l=php-general > ------------------------------------------ > /* > You have taken yourself too seriously. > */

« previous php.general (#169277) next »