2019-07-16 16:08 BST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0002639LibNSBMP[All Projects] Generalpublic2019-05-06 15:48
Reportergrim 
Assigned ToMichael Drake 
PrioritynormalSeverityminorReproducibilityalways
StatusassignedResolutionopen 
Summary0002639: The "cursor" subtype of the icon format is not recognized.
DescriptionWindows Icon files have two subtypes "icon" and "cursor". The only difference between them is that with "icon" values for colorplanes and bits per pixel can be defined (which are ignored by libnsbmp from what I can see). While "cursor" has values for hotspot position (which ain't relevant in this case). So the fix is very trivial.

Why this matters to me is because I use libnsbmp to decode the embedded icons in Windows Animated Cursor files. The frames can be of ether subtype. And what I do now is simply altering the byte in the header to make libnsbmp accept the "cursor" subtype. (It works but is kind of uggly.)
Additional Informationhttps://en.wikipedia.org/wiki/ICO_(file_format)
http://fileformats.archiveteam.org/wiki/ICO
http://fileformats.archiveteam.org/wiki/CUR
http://fileformats.archiveteam.org/wiki/Windows_Animated_Cursor
TagsNo tags attached.
Fixed in CI build #
Reported in CI build #
Attached Files
  • patch file icon libnsbmp-20190319-cur.patch (582 bytes) 2019-03-19 22:46 -
    diff --git a/src/libnsbmp.c b/src/libnsbmp.c
    index 97391e4..b36c385 100644
    --- a/src/libnsbmp.c
    +++ b/src/libnsbmp.c
    @@ -434,7 +434,7 @@ static bmp_result ico_header_parse(ico_collection *ico, uint8_t *data)
                     return BMP_INSUFFICIENT_DATA;
             //      if (read_int16(data, 2) != 0x0000)
             //              return BMP_DATA_ERROR;
    -        if (read_uint16(data, 2) != 0x0001)
    +        if (read_uint16(data, 2) != 0x0001 && read_uin16(data, 2) != 0x0002)
                     return BMP_DATA_ERROR;
             count = read_uint16(data, 4);
             if (count == 0)
    
    patch file icon libnsbmp-20190319-cur.patch (582 bytes) 2019-03-19 22:46 +

-Relationships
+Relationships

-Notes
There are no notes attached to this issue.
+Notes

-Issue History
Date Modified Username Field Change
2019-03-19 22:46 grim New Issue
2019-03-19 22:46 grim File Added: libnsbmp-20190319-cur.patch
2019-05-06 15:48 Michael Drake Assigned To => Michael Drake
2019-05-06 15:48 Michael Drake Status new => assigned
+Issue History