Skip to content

Generated ICO files use an incorrect ICONDIRENTRY height bit when the ICO is bitmap format #167

@jackbuehner

Description

@jackbuehner

For at least some bitmap ICO files, the ICO files output by RemoteApp Tool appear to have the wrong height in the ICONDIRENTRY height bit.

Bitmap ICO files actually contain a bitmap with a height that is twice the height of the icon because the bitmap contains the icon data in the first veritical half, and the second vertical half is a mask indicating which pixels from the bitmap to draw (this allows icons with transparent pixels). The ICONDIRENTRY height bit must be half the height of the bitmap so that the icon has a declared square width.

Some icon viewers can handle when the ICO file's height bit is wrong. Browsers fail to load the ico when the height bit is wrong. This is problematic when the ICO file is used in applications such as RAWeb.

I was able to confirm this behavior with WakeMeOnLan's exe, but there are some additional examples at kimmknight/raweb#69.

I don't have a full understanding of the way RemoteApp Tool works, but it looks like it is using ExtractIconEx from shell32.dll, just like RAWeb. The implimentation in RAWeb converts the icons to PNG before serving the to the browser, so that may be a potential solution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions