[phpBB Debug] PHP Warning: in file [ROOT]/includes/crs/crs_misc_functions.php on line 37: mime_content_type(): Empty filename or path
[phpBB Debug] PHP Warning: in file [ROOT]/includes/crs/crs_misc_functions.php on line 37: mime_content_type(): Empty filename or path
Zen Cart 源代码 bmz_gif_info.class.php

Zen Cart 源代码 bmz_gif_info.class.php




下载文件

文件名: bmz_gif_info.class.php
文件类型: PHP文件
文件大小: 1.77 KiB
MD5: d21a440f1977ffe2f76e956d5df22f72

bmz_gif_info.class.php - 关闭高亮
  1. <?php
  2. /**
  3.  * gif_info.php
  4.  * gif-info class for transparency stuff
  5.  *
  6.  * @author  Tim Kroeger (original author)
  7.  * @copyright Copyright 2005-2006
  8.  * @license http://www.gnu.org/licenses/gpl.txt GNU General Public License V2.0
  9.  * @version $Id: ibmz_gif_info.class.php,v 2.0 Rev 8 2010-05-31 23:46:5 DerManoMann Exp $
  10.  * Last modified by DerManoMann 2010-05-31 23:46:50
  11.  */
  12.  
  13.    class gifinfo
  14.    {
  15.        var $m_transparentRed;
  16.        var $m_transparentGreen;
  17.        var $m_transparentBlue;
  18.        var $m_signature;
  19.        var $m_version;
  20.        var $m_width;
  21.        var $m_height;
  22.        var $m_colorFlag;
  23.        var $m_backgroundIndex;
  24.      
  25.      
  26.        function gifinfo($filename)
  27.        {
  28.  
  29.            $fp                        = fopen($filename,"rb");
  30.            $result                    = fread($fp,13);
  31.            $this->m_signature    = substr($result,0,3);
  32.            $this->m_version        = substr($result,3,3);
  33.            $this->m_width        = ord(substr($result,6,1)) + ord(substr($result,7,1)) * 256;
  34.            $this->m_height        = ord(substr($result,8,1)) + ord(substr($result,9,1)) * 256;
  35.            $this->m_colorFlag    = ord(substr($result,10,1)) >> 7;
  36.            $this->m_background    = ord(substr($result,11));
  37.  
  38.            if($this->m_colorFlag)
  39.            {
  40.                $tableSizeNeeded = ($this->m_background + 1) * 3;
  41.                $result = fread($fp,$tableSizeNeeded);
  42.                $this->m_transparentRed    = ord(substr($result,$this->m_background * 3,1));
  43.                $this->m_transparentGreen    = ord(substr($result,$this->m_background * 3 + 1,1));      
  44.                $this->m_transparentBlue    = ord(substr($result,$this->m_background * 3 + 2,1));          
  45.            }
  46.            fclose($fp);
  47.        }
  48.    }