Page 1 of 1

32b BMPs are displayed incorrectly

Posted: Thu Jun 26, 2008 9:27 pm
by entryway
XnView (all versions I have: the latest release and the latest beta) cannot display 32b BMPs in the browser.

Browser: http://prboom-plus.sourceforge.net/32bpp-xnview.png

BMPs: http://prboom-plus.sourceforge.net/32bpp-xnview.zip


---
I have found an answer:
http://newsgroup.xnview.com/viewtopic.php?t=15377

Ok, Ctrl-H do fix this problem in preview window, but not in browser. Can such bmps be autodetected?

Re: 32b BMPs are displayed incorrectly

Posted: Fri Jun 27, 2008 8:36 am
by xnview
Your bmp have a bad alpha channel, so disable 'Use alpha'

Posted: Fri Jun 27, 2008 11:11 am
by entryway
xnview wrote:Your bmp have a bad alpha channel, so disable 'Use alpha'
btw, these bmps are created by Delphi with Image1.Picture.SaveToFile();

Posted: Fri Jun 27, 2008 1:39 pm
by xnview
entryway wrote:
xnview wrote:Your bmp have a bad alpha channel, so disable 'Use alpha'
btw, these bmps are created by Delphi with Image1.Picture.SaveToFile();
Check the alpha channel, all is black

Posted: Fri Jun 27, 2008 2:13 pm
by entryway
xnview wrote:Check the alpha channel, all is black
you are mistaken

biBitCount is 32 and biCompression is 0 in header of my BMPs

Code: Select all

typedef struct tagBITMAPINFOHEADER{
  DWORD  biSize; 
  LONG   biWidth; 
  LONG   biHeight; 
  WORD   biPlanes; 
  WORD   biBitCount; 
  DWORD  biCompression; 
  DWORD  biSizeImage; 
  LONG   biXPelsPerMeter; 
  LONG   biYPelsPerMeter; 
  DWORD  biClrUsed; 
  DWORD  biClrImportant; 
} BITMAPINFOHEADER, *PBITMAPINFOHEADER;
in this case the image has no palette and high-byte of each four-bytes group should not be used

http://msdn.microsoft.com/en-us/library ... S.85).aspx
biBitCount - 32
The bitmap has a maximum of 2^32 colors. If the biCompression member of the BITMAPINFOHEADER is BI_RGB, the bmiColors member of BITMAPINFO is NULL. Each DWORD in the bitmap array represents the relative intensities of blue, green, and red, respectively, for a pixel. The high byte in each DWORD is not used.

Posted: Fri Jun 27, 2008 3:02 pm
by xnview
No, else you can't load correctly such file http://www.xnview.com/beta/desktop_icon_03.bmp

But it seems that if alpha channel is all black, the channel alpha must be ignored, i'll add that

Sample OK

Posted: Fri Jun 27, 2008 3:30 pm
by Clo
:arrow: Pierre

:) Hello !

• Your sample <desktop_icon_03.bmp> works OK here with the Alpha channel “ON”…

:mrgreen: KR
Claude
Clo

Posted: Mon Jul 21, 2008 11:55 pm
by entryway
1.94 release + 32bit BMP == crash

drwatson log + BMP:
http://prboom-plus.sourceforge.net/xnview_194_crash.zip

This crash happens only in a browser mode

Stack trace from the log:

Code: Select all

Exception number: c0000005 (access violation)

ChildEBP RetAddr  Args to Child              
01abf9c0 0059c528 00d80000 00000000 00e13fe8 ntdll!wcsncpy+0x354
01abfa08 005a2e3c 00e13fe8 00723258 0059c193 xnview+0x19c528
00d89440 005b0980 005b1300 005b4aa0 005cca20 xnview+0x1a2e3c
005af340 58245c8b 246c8b55 538b6658 0f665618 xnview+0x1b0980
534cec83 00000000 00000000 00000000 00000000 0x58245c8b

Posted: Tue Jul 22, 2008 9:24 am
by xnview
entryway wrote:1.94 release + 32bit BMP == crash

drwatson log + BMP:
http://prboom-plus.sourceforge.net/xnview_194_crash.zip

This crash happens only in a browser mode
Really? Which OS?

Posted: Tue Jul 22, 2008 9:36 am
by xnview
Ok, i think that the problem is with option/General/Ignore alpha channel

Posted: Tue Jul 22, 2008 10:42 am
by entryway
xnview wrote:Ok, i think that the problem is with option/General/Ignore alpha channel
Yes, you are right