32b BMPs are displayed incorrectly

Bugs found in XnView Classic. Please report only one bug per topic!

Moderators: XnTriq, xnview

entryway
Posts: 10
Joined: Thu Jun 26, 2008 9:18 pm

32b BMPs are displayed incorrectly

Post 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?
User avatar
xnview
Author of XnView
Posts: 36798
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: 32b BMPs are displayed incorrectly

Post by xnview »

Your bmp have a bad alpha channel, so disable 'Use alpha'
Pierre.
entryway
Posts: 10
Joined: Thu Jun 26, 2008 9:18 pm

Post 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();
User avatar
xnview
Author of XnView
Posts: 36798
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Post 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
Pierre.
entryway
Posts: 10
Joined: Thu Jun 26, 2008 9:18 pm

Post 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.
User avatar
xnview
Author of XnView
Posts: 36798
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Post 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
Pierre.
User avatar
Clo
XnThusiast
Posts: 4441
Joined: Sun Oct 17, 2004 4:57 am
Location: Bordeaux, France

Sample OK

Post by Clo »

:arrow: Pierre

:) Hello !

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

:mrgreen: KR
Claude
Clo
Old user ON SELECTIVE STRIKE till further notice
entryway
Posts: 10
Joined: Thu Jun 26, 2008 9:18 pm

Post 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
User avatar
xnview
Author of XnView
Posts: 36798
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Post 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?
Pierre.
User avatar
xnview
Author of XnView
Posts: 36798
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Post by xnview »

Ok, i think that the problem is with option/General/Ignore alpha channel
Pierre.
entryway
Posts: 10
Joined: Thu Jun 26, 2008 9:18 pm

Post by entryway »

xnview wrote:Ok, i think that the problem is with option/General/Ignore alpha channel
Yes, you are right