PHP Classes

Undefined offset error

Recommend this page to a friend!

      Animated GIF into images  >  All threads  >  Undefined offset error  >  (Un) Subscribe thread alerts  
Subject:Undefined offset error
Summary:Undefined offset error message
Messages:3
Author:Stephen Renton
Date:2010-11-16 15:29:42
Update:2014-01-12 13:37:57
 

  1. Undefined offset error   Reply   Report abuse  
Picture of Stephen Renton Stephen Renton - 2010-11-16 15:29:42
I am getting an error message of the following:
Notice: Undefined offset: 4 in C:\...\GIFDecoder.class.php on line 104

The animated GIF is being split up into separate files, so this error does not seem to be stopping it from working.

However, is there a fix to prevent this error message?

Thanks.

  2. Re: Undefined offset error   Reply   Report abuse  
Picture of Asbjorn Grandt Asbjorn Grandt - 2014-01-12 13:24:55 - In reply to message 1 from Stephen Renton
I have this problem as well. Did you find the cause and/or a solution?

  3. Re: Undefined offset error   Reply   Report abuse  
Picture of Asbjorn Grandt Asbjorn Grandt - 2014-01-12 13:37:57 - In reply to message 2 from Asbjorn Grandt
Essentially, line 104 can NEVER work. Why? Because in line 103 the if statement tests if the length of the buffer is exactly 4 bytes. The largest allowed index is therefore 3.

102: GIFDecoder::GIFGetByte ( $u );
103: if ( $u == 0x04 ) {
104: if ( $this->GIF_buffer [ 4 ] & 0x80 ) {

From what I can understand of this link: http://www.fileformat.info/format/gif/egff.htm#GIF-DMYID.3.2.1

The correct index is 0