示例#1
0
 /**
  * @param FileHandler             $fh
  * @param FileHandler             $fhW
  * @param float                   $ratio
  * @param LogicalScreenDescriptor $lsd
  */
 private static function readExtensionBlock($fh, $fhW, $ratio, $lsd)
 {
     $fh->seekForward(1);
     $blockLabel = $fh->peekByte();
     switch (ord($blockLabel)) {
         case AbstractExtensionBlock::LABEL_APPLICATION:
             $adb = new ApplicationExtension($fh);
             $adb->encodeToFile($fhW);
             break;
         case AbstractExtensionBlock::LABEL_COMMENT:
             $ceb = new CommentExtension($fh);
             $ceb->encodeToFile($fhW);
             break;
         case AbstractExtensionBlock::LABEL_GRAPHICS_CONTROL:
             $gce = new GraphicControlExtension($fh);
             self::resizeGraphicControlExtensionBlock($gce, $ratio, $fhW, $lsd);
             break;
         case AbstractExtensionBlock::LABEL_PLAIN_TEXT:
             $pte = new PlainTextExtension($fh);
             $pte->encodeToFile($fhW);
             break;
         case AbstractExtensionBlock::CONTROL_TRAILER:
             break;
         default:
             $fh->seekForward(1);
             while (!$fh->compareByte("")) {
                 $fh->seekForward(1);
             }
     }
     if ($fh->compareByte("")) {
         $fh->readByte();
     }
 }
示例#2
0
 /**
  * @param CommentExtension $ceb
  */
 public static function dumpCommentExtensionBlock($ceb)
 {
     echo " Comment Extension Block............: CEB 0xFE (254)\n";
     echo "  - sub blocks total length.........: " . BinStringStatic::_strlen($ceb->dataSubBlocks) . "\n";
     echo "  - sub blocks content..............: " . $ceb->getComment() . "\n";
 }