RE: [PHP] ImageCreateFromJpeg()

From: Date: Thu, 13 Jul 2000 17:52:37 +0000
Subject: RE: [PHP] ImageCreateFromJpeg()
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-6512@lists.php.net to get a copy of this message
It doesn't work anyways. I get this error message: <b>Warning</b>: ImageCreateFromGif: Unable to open http://www.goatrider.com/image.php?id=1&scale=1 for reading in <b>/home/httpd/htdocs/goatrider/image.php</b> on line <b>18</b><br> So, ImageCreateFromGif() doesn't seem to be able to read from HTTP. > From: Benton Jackson [mailto:goatrider@goatrider.com] > > Nice. Or ghastly, depending on how Apache works. I don't know enough about > that. > > If I open a file with HTTP through the local server, is it smart enough to > do it efficiently? If so, this would work nicely. If it has to go through > TCP/IP, I might as well write a temporary file. > > > From: Jerry [mailto:jerry@acusd.edu] > > > > goatrider@goatrider.com ("Benton Jackson") wrote: > > > > > I have an image file that's in a database, how can I read it into an > > > Image? > > > I could write it to a file first, and then do > > "ImageCreateFromJpeg", but > > > the > > > whole point of this exercise is to avoid writing files. > > > > By default, ImageCreateFromxxx only works on files and URLs. It should > > be relatively easy, if you are familiar with C, to make it work on > > strings. > > > > However, a work-around would be to create it from a URL. > > > > <?php > > header("Content-type: image/jpg"); > > if ($Image) { > > //we want to modify the image > > $requiredImage = URLEncode($Image); > > $theImage = ImageCreateFromJPEG("$PHP_SELF?Raw=$requiredImage"); > > list($copyowner,$left,$bottom) = getInfoFromDB($Image); > > imagettftext ($theImage, 12, 0, $left,$bottom, $Black, > > "/fonts/Courier.ttf", "Copyright 1963 $copyowner") > > ImageJPEG($theImage); > > } elseif ($Raw) { > > //we are requesting the image raw from the database > > $theImage = getImageFromDB($Raw); > > echo $theImage; > > } else { > > //we don't know what we're doing > > $theImage = createWarningIMG("Huh?"); > > ImageJPEG($theImage); > > } > > ?> > > > > http://www.bloodandgore.com/Images.php3?Image=Zapruder > > > > should return the image as a modified JPG file (if bloodandgore.com > > were running this script, which they aren't). > > > > Note that getInfoFromDB, getImageFromDB, and createWarningIMG are > > functions you'd have to create from your own knowledge of your > > database. > > > > > > Jerry > > http://www.hoboes.com/jerry/ > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > > For additional commands, e-mail: php-general-help@lists.php.net > > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#6512) next »