static int DIB_GetBitmapInfo( const BITMAPINFOHEADER *header, LONG *width,
LONG *height, WORD *bpp, DWORD *compr )
{
+ #define CR 13
+ #define LF 10
+ #define EOFM 26 // DOS End Of File Marker
+ #define HighBitDetect 0x89 // Byte with high bit set to test if not 7-bit
+ /* wine's definition */
+ static const BYTE png_sig_pattern[] = { HighBitDetect, 'P', 'N', 'G', CR, LF, EOFM, LF };
if (header->biSize == sizeof(BITMAPCOREHEADER))
{
const BITMAPCOREHEADER *core = (const BITMAPCOREHEADER *)header;
*compr = header->biCompression;
return 1;
}
- ERR("(%d): unknown/wrong size for header\n", header->biSize );
+ if (memcmp(&header->biSize, png_sig_pattern, sizeof(png_sig_pattern)) == 0)
+ {
+ ERR("Cannot yet display PNG icons\n");
+ /* for PNG format details see https://en.wikipedia.org/wiki/PNG */
+ }
+ else
+ {
+ ERR("Unknown/wrong size for header of 0x%x\n", header->biSize );
+ }
return -1;
}
/* Do the dance */
if(!CURSORICON_GetCursorDataFromBMI(&cursorData, (BITMAPINFO*)(&bits[entry->dwDIBOffset])))
- goto end;
+ {
+ ERR("Failing File is \n '%S'.\n", lpszName);
+ goto end;
+ }
hCurIcon = NtUserxCreateEmptyCurObject(FALSE);
if(!hCurIcon)