PHP Classes


Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in Bookmark in

      floIcon  >  All threads  >  endianness  >  (Un) Subscribe thread alerts  
Summary:ico files are encoded in little-endian
Author:Matthieu Codron
Date:2013-04-29 09:55:22

  1. endianness   Reply   Report abuse  
Picture of Matthieu Codron Matthieu Codron - 2013-04-29 09:55:22
while ico files are encoded in little-endian (cf., your script does not force unpack to read values as little endian (you are machine endianness dependent).

For example, in \floIconImage::readImageFromICO, you should use

$this->_entry = unpack("CWidth/CHeight/CColorCount/CReserved/vPlanes/vBitCount/VSizeInBytes/VFileOffset", $this->_entryIconFormat);


$this->_header = unpack("VSize/VWidth/VHeight/vPlanes/vBitCount/VCompression/VImageSize/VXpixelsPerM/VYpixelsPerM/VColorsUsed/VColorsImportant", $this->_headerIconFormat);

I did not check all your code against this issue

  2. Re: endianness   Reply   Report abuse  
Picture of Joshua hatfield Joshua hatfield - 2015-04-08 16:33:12 - In reply to message 1 from Matthieu Codron
Thank you. I'll see about that.