예제 #1
0
파일: GIF.class.php 프로젝트: xibaachao/1bz
 function GIFReadDescriptor()
 {
     $GIF_screen = array();
     GIFDecoder::GIFGetByte(9);
     $GIF_screen = $this->GIF_buffer;
     $GIF_colorF = $this->GIF_buffer[8] & 0x80 ? 1 : 0;
     if ($GIF_colorF) {
         $GIF_code = $this->GIF_buffer[8] & 0x7;
         $GIF_sort = $this->GIF_buffer[8] & 0x20 ? 1 : 0;
     } else {
         $GIF_code = $this->GIF_colorC;
         $GIF_sort = $this->GIF_sorted;
     }
     $GIF_size = 2 << $GIF_code;
     $this->GIF_screen[4] &= 0x70;
     $this->GIF_screen[4] |= 0x80;
     $this->GIF_screen[4] |= $GIF_code;
     if ($GIF_sort) {
         $this->GIF_screen[4] |= 0x8;
     }
     $this->GIF_string = "GIF87a";
     GIFDecoder::GIFPutByte($this->GIF_screen);
     if ($GIF_colorF == 1) {
         GIFDecoder::GIFGetByte(3 * $GIF_size);
         GIFDecoder::GIFPutByte($this->GIF_buffer);
     } else {
         GIFDecoder::GIFPutByte($this->GIF_global);
     }
     $this->GIF_string .= chr(0x2c);
     $GIF_screen[8] &= 0x40;
     GIFDecoder::GIFPutByte($GIF_screen);
     GIFDecoder::GIFGetByte(1);
     GIFDecoder::GIFPutByte($this->GIF_buffer);
     for (;;) {
         GIFDecoder::GIFGetByte(1);
         GIFDecoder::GIFPutByte($this->GIF_buffer);
         if (($u = $this->GIF_buffer[0]) == 0x0) {
             break;
         }
         GIFDecoder::GIFGetByte($u);
         GIFDecoder::GIFPutByte($this->GIF_buffer);
     }
     $this->GIF_string .= chr(0x3b);
     /*
        Add frames into $GIF_stream array...
     */
     $this->GIF_arrays[] = $this->GIF_string;
 }
예제 #2
0
파일: gifsplit.php 프로젝트: bthurvi/oophp
 function GIFReadDescriptor()
 {
     $GIF_screen = array();
     GIFDecoder::GIFGetByte(9);
     $GIF_screen = $this->GIF_buffer;
     $GIF_colorF = $this->GIF_buffer[8] & 0x80 ? 1 : 0;
     if ($GIF_colorF) {
         $GIF_code = $this->GIF_buffer[8] & 0x7;
         $GIF_sort = $this->GIF_buffer[8] & 0x20 ? 1 : 0;
     } else {
         $GIF_code = $this->GIF_colorC;
         $GIF_sort = $this->GIF_sorted;
     }
     $GIF_size = 2 << $GIF_code;
     $this->GIF_screen[4] &= 0x70;
     $this->GIF_screen[4] |= 0x80;
     $this->GIF_screen[4] |= $GIF_code;
     if ($GIF_sort) {
         $this->GIF_screen[4] |= 0x8;
     }
     /* 
      * 
      * GIF Data Begin 
      * 
      */
     if ($this->GIF_TransparentI) {
         $this->GIF_string = "GIF89a";
     } else {
         $this->GIF_string = "GIF87a";
     }
     GIFDecoder::GIFPutByte($this->GIF_screen);
     if ($GIF_colorF == 1) {
         GIFDecoder::GIFGetByte(3 * $GIF_size);
         if ($this->GIF_TransparentI) {
             $this->GIF_TransparentR = $this->GIF_buffer[3 * $this->GIF_TransparentI + 0];
             $this->GIF_TransparentG = $this->GIF_buffer[3 * $this->GIF_TransparentI + 1];
             $this->GIF_TransparentB = $this->GIF_buffer[3 * $this->GIF_TransparentI + 2];
         }
         GIFDecoder::GIFPutByte($this->GIF_buffer);
     } else {
         if ($this->GIF_TransparentI) {
             $this->GIF_TransparentR = $this->GIF_global[3 * $this->GIF_TransparentI + 0];
             $this->GIF_TransparentG = $this->GIF_global[3 * $this->GIF_TransparentI + 1];
             $this->GIF_TransparentB = $this->GIF_global[3 * $this->GIF_TransparentI + 2];
         }
         GIFDecoder::GIFPutByte($this->GIF_global);
     }
     if ($this->GIF_TransparentI) {
         $this->GIF_string .= "!ù" . chr($this->GIF_TransparentI) . "";
     }
     $this->GIF_string .= chr(0x2c);
     $GIF_screen[8] &= 0x40;
     GIFDecoder::GIFPutByte($GIF_screen);
     GIFDecoder::GIFGetByte(1);
     GIFDecoder::GIFPutByte($this->GIF_buffer);
     for (;;) {
         GIFDecoder::GIFGetByte(1);
         GIFDecoder::GIFPutByte($this->GIF_buffer);
         if (($u = $this->GIF_buffer[0]) == 0x0) {
             break;
         }
         GIFDecoder::GIFGetByte($u);
         GIFDecoder::GIFPutByte($this->GIF_buffer);
     }
     $this->GIF_string .= chr(0x3b);
     /* 
      * 
      * GIF Data End 
      * 
      */
     $this->GIF_arrays[] = $this->GIF_string;
 }