CGIFFILEHEADER

The Gravity PDF CGIFFILEHEADER class.

Defined (1)

The class is defined in the following location(s).

/vendor/blueliquiddesigns/mpdf/classes/gif.php  
  1. class CGIFFILEHEADER 
  2.  
  3. var $m_lpVer; 
  4.  
  5. var $m_nWidth; 
  6.  
  7. var $m_nHeight; 
  8.  
  9. var $m_bGlobalClr; 
  10.  
  11. var $m_nColorRes; 
  12.  
  13. var $m_bSorted; 
  14.  
  15. var $m_nTableSize; 
  16.  
  17. var $m_nBgColor; 
  18.  
  19. var $m_nPixelRatio; 
  20.  
  21. var $m_colorTable; 
  22.  
  23. public function __construct() 
  24. unSet($this->m_lpVer); 
  25. unSet($this->m_nWidth); 
  26. unSet($this->m_nHeight); 
  27. unSet($this->m_bGlobalClr); 
  28. unSet($this->m_nColorRes); 
  29. unSet($this->m_bSorted); 
  30. unSet($this->m_nTableSize); 
  31. unSet($this->m_nBgColor); 
  32. unSet($this->m_nPixelRatio); 
  33. unSet($this->m_colorTable); 
  34.  
  35. function load($lpData, &$hdrLen) 
  36. $hdrLen = 0; 
  37.  
  38. $this->m_lpVer = substr($lpData, 0, 6); 
  39. if (($this->m_lpVer <> "GIF87a") && ($this->m_lpVer <> "GIF89a")) { 
  40. return false; 
  41.  
  42. $this->m_nWidth = $this->w2i(substr($lpData, 6, 2)); 
  43. $this->m_nHeight = $this->w2i(substr($lpData, 8, 2)); 
  44. if (!$this->m_nWidth || !$this->m_nHeight) { 
  45. return false; 
  46.  
  47. $b = ord(substr($lpData, 10, 1)); 
  48. $this->m_bGlobalClr = ($b & 0x80) ? true : false; 
  49. $this->m_nColorRes = ($b & 0x70) >> 4; 
  50. $this->m_bSorted = ($b & 0x08) ? true : false; 
  51. $this->m_nTableSize = 2 << ($b & 0x07); 
  52. $this->m_nBgColor = ord(substr($lpData, 11, 1)); 
  53. $this->m_nPixelRatio = ord(substr($lpData, 12, 1)); 
  54. $hdrLen = 13; 
  55.  
  56. if ($this->m_bGlobalClr) { 
  57. $this->m_colorTable = new CGIFCOLORTABLE(); 
  58. if (!$this->m_colorTable->load(substr($lpData, $hdrLen), $this->m_nTableSize)) { 
  59. return false; 
  60. $hdrLen += 3 * $this->m_nTableSize; 
  61.  
  62. return true; 
  63.  
  64. function w2i($str) 
  65. return ord(substr($str, 0, 1)) + (ord(substr($str, 1, 1)) << 8); 
  66.