PHP Classes

GIFEncoder V2.05: 0 Source is not a GIF image!

Recommend this page to a friend!

      GIF images into animated GIF with native PHP class  >  All threads  >  GIFEncoder V2.05: 0 Source is not a...  >  (Un) Subscribe thread alerts  
Subject:GIFEncoder V2.05: 0 Source is not a...
Summary:Using dynamically generated GIFs in a series is failing.
Messages:4
Author:Gamecharmer
Date:2009-04-10 09:23:26
Update:2010-06-01 18:15:49
 

  1. GIFEncoder V2.05: 0 Source is not a...   Reply   Report abuse  
Picture of Gamecharmer Gamecharmer - 2009-04-10 09:23:26
I setup the example and have it working on my server.
I renamed the frames folder to Xframes
I created a new folder called frames
I placed three files inside of the frames folder located here
gamecharmer.com/universal/signature ...

Each of these files contain code just like the following...

<?php

$imagefile = 'http://daeworld.net/phpBB3/signatures/sig.gif';

$image = imagecreatefromgif($imagefile);

header('Content-Type: image/gif');
imagegif($image);

?>

I can view each file and they appear as GIF.
I can save each file, and I have opened all three with Notepad++ and retrieved the first 6 bytes. They are "GIF87a"
When I run Example.php, I get "GIFEncoder V2.05: 0 Source is not a GIF image!"

What should I be doing differently?

I tried using a .htaccess file so that I could rename the .php to .gif and still have it process, which worked fine on the server for the individual images, but still yeilded the same error. I then modified the example.php with an if to block ".htaccess" from being added to the array. That didn't work. I undid the changes, removed .htaccess (leaving just 3 php files) and await a hopefully working response.

Thanks!

  2. Re: GIFEncoder V2.05: 0 Source is not a...   Reply   Report abuse  
Picture of László Zsidi László Zsidi - 2009-04-11 06:46:36 - In reply to message 1 from Gamecharmer
i just thought you set the frames extensions as .gif in the frames array and your process php script was generated the frames with .php extensions.
Try to pickup between your process script a plus header line:

<?php

$imagefile = 'http://daeworld.net/phpBB3/signatures/sig.gif';

$image = imagecreatefromgif($imagefile);

header('Content-Type: image/gif');
header('Content-disposition:attachment;filename=frame.gif');

imagegif($image);

?>

  3. Re: GIFEncoder V2.05: 0 Source is not a...   Reply   Report abuse  
Picture of Gamecharmer Gamecharmer - 2009-08-19 03:00:49 - In reply to message 2 from László Zsidi
I gave it a shot.

Here's what I have going...

Image file... daeworld.php
Contents
<?php

$imagefile = 'http://daeworld.net/phpBB3/signatures/sig.gif';

$image = imagecreatefromgif($imagefile);

header('Content-Type: image/gif');
header('Content-disposition:attachment;filename=daeworld.gif');
imagegif($image);

?>

Firefox can't view the image files anymore, but it does save them and they do appear correctly when viewed locally.

The script still returns the same error. :(

Here is the HTAccess file

RewriteEngine on
RewriteRule ^daeworld.gif$ daeworld.php


Short of building some kind of crazy system that builds a gif from scratch and connects to 4 different databases, I'm out of ideas...

  4. Re: GIFEncoder V2.05: 0 Source is not a...   Reply   Report abuse  
Picture of wwildlion wwildlion - 2010-06-01 18:15:49 - In reply to message 3 from Gamecharmer
Hi, All.

I found this string in Gif Encoder class

if ( substr ( $this->BUF [ $i ], 0, 6 ) != "GIF87a" && substr ( $this->BUF [ $i ], 0, 6 ) != "GIF89a" ) {
printf ( "%s: %d %s", $this->VER, $i, $this->ERR [ 'ERR01' ] );
exit ( 0 );
}

It blow my head out. You take image name and check, if it have "GIF87a" or "GIF89a" header.

:)