Re: Image GD Wizardry!
| From: | Dennis Moore | Date: | Thu, 27 Jun 2002 00:57:37 +0000 |
| Subject: | Re: Image GD Wizardry! | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-104079@lists.php.net to get a copy of this message | ||
I think GIF support was removed from GD several releases ago due to
licensing reasons...
/dkm
----- Original Message -----
From: "Shane" <shane@delaplaine.com>
To: "php" <php-general@lists.php.net>
Sent: Wednesday, June 26, 2002 6:48 PM
Subject: [PHP] Image GD Wizardry!
> One would think that pulling binary data from a DB using the function
imageCreateFromString would allow you to output that string to any format.
(GIF JPEG PNG) or whatever is supported by your version of GD.
>
> But this code flakes out and creates no image if it reads from a binary
file made by a GIF file. (works great for JPEGs!!)
>
> Anyone see what the problem might be? Or know of any way to output a JPEG
or PNG from a binary GIF file in a mySQL DB?
>
> Theory code only...
>
> 1. Query binary string from DB
> 2. Create Image From String
> 3. Scale your image to fit the size you need.
> 4. Use ImageCreateTrueColor to create your compatible background square
> 5. Fill it with your background color using ImageFilledRectangle
> 6. Use ImageCopyResampled to place your Image from String onto you
background image
> 7. use imageJpeg to output your true color image as a JPEG
>
> Since this works great as JPEG IN, JPEG OUT, but does NOT work when GIF is
the source, is this because ImageCopyResampled can't use the GIF image?
>
> If so, anyone have a nice code snippet that will turn client uploads from
GIFs into JPEGS?
>
> - Thanks in advance folks, I realize this is a tough one, and any
suggestions are always greatly appreciated, and as always I will post my
final solution for the archives.
>
> Thanks again.
> -NorthBayShane
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>