Merge pull request #579 from im-mi/fix-ico-256-256

Fix .ico when size is 256 x 256
This commit is contained in:
Shish 2016-09-02 15:50:46 +01:00 committed by GitHub
commit e96a5e1109

View file

@ -72,8 +72,10 @@ class IcoFileHandler extends Extension {
$subheader = unpack("cwidth/cheight/ccolours/cnull/splanes/sbpp/lsize/loffset", fread($fp, 16)); $subheader = unpack("cwidth/cheight/ccolours/cnull/splanes/sbpp/lsize/loffset", fread($fp, 16));
fclose($fp); fclose($fp);
$image->width = $subheader['width']; $width = $subheader['width'];
$image->height = $subheader['height']; $height = $subheader['height'];
$image->width = width == 0 ? 256 : width;
$image->height = height == 0 ? 256 : height;
$image->filesize = $metadata['size']; $image->filesize = $metadata['size'];
$image->hash = $metadata['hash']; $image->hash = $metadata['hash'];