Image viewer incorrectly previews Windows ico as garbage pixels if last texture size is 256

Bug #2021518 reported by Long Nguyen Huu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
eog (Ubuntu)
New
Undecided
Unassigned

Bug Description

ImageViewer version: 42.0

ImageMagick version (should not matter, ImageMagick seems to be doing its work correctly and it's in another package, but dropping just FYI):
$ convert --version
Version: ImageMagick 6.9.11-60 Q16 x86_64 2021-01-25 https://imagemagick.org
Copyright: (C) 1999-2021 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Cipher DPC Modules OpenMP(4.5)
Delegates (built-in): bzlib djvu fftw fontconfig freetype heic jbig jng jp2 jpeg lcms lqr ltdl lzma openexr pangocairo png tiff webp wmf x xml zlib

I was following instructions on https://askubuntu.com/questions/867567/convert-jpg-or-png-to-ico-using-terminal-and-back and https://superuser.com/questions/491180/how-do-i-embed-multiple-sizes-in-an-ico-file to generate a Windows icon from separate pngs.

While instructions like:

$ convert icon_256.png -define icon:auto-resize=256,128,64,48,32,16 icon.ico
and
$ convert icon_256.png icon_128.png icon_64.png icon_32.png icon_16.png icon.ico

will generate a Windows .ico that can be previewed without issues in Image Viewer, although it will only show the 128x128 image, not the bigger 256x256 (not sure if it's a bug or by design).

If you swap sizes to put 256 at the end (you can also switch to ascending sizes but it's not necessary):

$ convert icon_256.png -define icon:auto-resize=128,64,48,32,16,256 icon.ico
and
$ convert icon_128.png icon_64.png icon_32.png icon_16.png icon_256.png icon.ico

will generate a proper .ico (textures are simply stored in a different order, as can be shown by extracting them with convert icon.icon extracted_icon.png) and looking at the generated files in order of numerical suffixes.

but when opening icon.ico, ImageViewer will show a 128x128 image with only the bottom part filled with garbage pixels (see screenshot).

Revision history for this message
Long Nguyen Huu (n-huu-long) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.