Ejemplo n.º 1
0
 function GIFDecoder($GIF_pointer)
 {
     $this->GIF_stream = $GIF_pointer;
     GIFDecoder::GIFGetByte(6);
     GIFDecoder::GIFGetByte(7);
     $this->GIF_screen = $this->GIF_buffer;
     $this->GIF_colorF = $this->GIF_buffer[4] & 0x80 ? 1 : 0;
     $this->GIF_sorted = $this->GIF_buffer[4] & 0x8 ? 1 : 0;
     $this->GIF_colorC = $this->GIF_buffer[4] & 0x7;
     $this->GIF_colorS = 2 << $this->GIF_colorC;
     if ($this->GIF_colorF == 1) {
         GIFDecoder::GIFGetByte(3 * $this->GIF_colorS);
         $this->GIF_global = $this->GIF_buffer;
     }
     for ($cycle = 1; $cycle;) {
         if (GIFDecoder::GIFGetByte(1)) {
             switch ($this->GIF_buffer[0]) {
                 case 0x21:
                     GIFDecoder::GIFReadExtensions();
                     break;
                 case 0x2c:
                     GIFDecoder::GIFReadDescriptor();
                     break;
                 case 0x3b:
                     $cycle = 0;
                     break;
             }
         } else {
             $cycle = 0;
         }
     }
 }
Ejemplo n.º 2
0
 function GIFDecoder($GIF_pointer)
 {
     $this->GIF_stream = $GIF_pointer;
     GIFDecoder::GIFGetByte(6);
     // GIF89a
     GIFDecoder::GIFGetByte(7);
     // Logical Screen Descriptor
     $this->GIF_screen = $this->GIF_buffer;
     $this->GIF_colorF = $this->GIF_buffer[4] & 0x80 ? 1 : 0;
     $this->GIF_sorted = $this->GIF_buffer[4] & 0x8 ? 1 : 0;
     $this->GIF_colorC = $this->GIF_buffer[4] & 0x7;
     $this->GIF_colorS = 2 << $this->GIF_colorC;
     if ($this->GIF_colorF == 1) {
         GIFDecoder::GIFGetByte(3 * $this->GIF_colorS);
         $this->GIF_global = $this->GIF_buffer;
     }
     /*
      *
      *  05.06.2007.
      *  Made a little modification
      *
      *
      -	for ( $cycle = 1; $cycle; ) {
      +		if ( GIFDecoder::GIFGetByte ( 1 ) ) {
      -			switch ( $this->GIF_buffer [ 0 ] ) {
      -				case 0x21:
      -					GIFDecoder::GIFReadExtensions ( );
      -					break;
      -				case 0x2C:
      -					GIFDecoder::GIFReadDescriptor ( );
      -					break;
      -				case 0x3B:
      -					$cycle = 0;
      -					break;
      -		  	}
      -		}
      +		else {
      +			$cycle = 0;
      +		}
      -	}
     */
     for ($cycle = 1; $cycle;) {
         if (GIFDecoder::GIFGetByte(1)) {
             switch ($this->GIF_buffer[0]) {
                 case 0x21:
                     GIFDecoder::GIFReadExtensions();
                     break;
                 case 0x2c:
                     GIFDecoder::GIFReadDescriptor();
                     break;
                 case 0x3b:
                     $cycle = 0;
                     break;
             }
         } else {
             $cycle = 0;
         }
     }
 }