Re: imagecreatefromgif fails for a valid image

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 9/24/07, thushw <thushw@xxxxxxxxx> wrote:
>
> I get a failure in creating a gif. php error log shows this:
>
> Sep 24 00:25:47 thushw-laptop apache2: PHP Warning:  imagecreatefromgif() [
> function.imagecreatefromgif function.imagecreatefromgif ]:
> '/home/thushw/mocha_src/LiveMocha/trunk/src/wwwroot/app/webroot/img/new/button-middle.gif'
> is not a valid GIF file in
> /home/thushw/mocha_src/LiveMocha/trunk/src/wwwroot/app/webroot/button.php on
> line 30
>
> the gif can be viewed by gthumb. it seems ok.
>
> the problem is only for some gifs. Most gifs, all pngs, jpegs that i've
> tested so far work.
>
> i'm running php5 on ubuntu (uname -a : Linux thushw-laptop 2.6.20.3-ubuntu1
> #2 SMP Sun Apr 15 11:26:58 PDT 2007 i686 GNU/Linux)
>
> phpinfo shows:
>
> gd
> GD Support      enabled
> GD Version      2.0 or higher
> FreeType Support        enabled
> FreeType Linkage        with freetype
> FreeType Version        2.2.1
> T1Lib Support   enabled
> GIF Read Support        enabled
> GIF Create Support      enabled
> JPG Support     enabled
> PNG Support     enabled
> WBMP Support    enabled
>
> from what i've read so far, seems like i need gd lib >=2.0.28. from phpinfo
> output it is not clear if i have the right version. i use: apt-get install
> php5-gd to install gd
>
> these are the files i think are of importance:
>
> /usr/lib/libgd.so.2.0.34
> /usr/lib/libgd.so.2
>
> [the second is a symlink to the first]
>
> >> ls -l /usr/lib/libgd.so.2
> lrwxrwxrwx 1 root root 15 2007-09-24 00:25 /usr/lib/libgd.so.2 ->
> libgd.so.2.0.34
>
> how do i debug this further?  any help greatly appreciated. this problem
> doesn't appear with the gd we have installed on our centos servers. seems to
> happen only on my ubuntu install.
>
> thushara
>

Hello Thushara:

My guess is that your .gif file isn't actually a GIF image (but jpeg, bmp,...).

If you have access to SSH/command line try running
file /home/thushw/mocha_src/LiveMocha/trunk/src/wwwroot/app/webroot/img/new/button-middle.gif
and see if it's really a gif, if you don't have access to above, open
the image with any text editor, and see what the first 3 letters say..
If it's an GIF image, it says GIF (GIF89 probably)
if it's an JPEG image, it says something like ÿØÿà
if it's an BMP image, it says BM (BM6)
and if it's an PNG image, it says ‰PNG

I hope this helps you..

Tijnema

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux