After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 694950 - BMP image has bogus header data error message on loading some BMP files
BMP image has bogus header data error message on loading some BMP files
Status: RESOLVED FIXED
Product: gdk-pixbuf
Classification: Platform
Component: loaders
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gdk-pixbuf-maint
gdk-pixbuf-maint
Depends on:
Blocks:
 
 
Reported: 2013-03-01 19:14 UTC by Mark
Modified: 2014-10-26 11:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
PNG version of the same image, showing what it should look like (416.90 KB, image/png)
2013-03-01 19:15 UTC, Mark
Details
BMP image, compressed with bzip2 (465.45 KB, application/octet-stream)
2013-03-01 19:16 UTC, Mark
Details

Description Mark 2013-03-01 19:14:34 UTC
Hi,

I created some BMP image files using the Microsoft AMCap2 program. Programs which use gdk-pixbuf to load the image fail, giving an error message "BMP image has bogus header data". For example gpicview and qiv give that error.

The images are viewable with Firefox, and also PNGOUT processes them correctly.

Attached is a sample image, both original BMP and a PNG created from it using PNGOUT.
Comment 1 Mark 2013-03-01 19:15:23 UTC
Created attachment 237731 [details]
PNG version of the same image, showing what it should look like
Comment 2 Mark 2013-03-01 19:16:31 UTC
Created attachment 237732 [details]
BMP image, compressed with bzip2
Comment 3 Bastien Nocera 2014-10-22 17:20:38 UTC
Reproduced with gdk-pixbuf 2.31.
Comment 4 Bastien Nocera 2014-10-26 11:11:07 UTC
The error was from the:
if (State->Header.n_colors > (1 << State->Header.depth)) {
error path.

It seems to be bogus as removing it fixes the problem.

commit 3c9c6b0c8330ebbd1b9557b9fc3c68020dc394b5
Author: Bastien Nocera <hadess@hadess.net>
Date:   Sun Oct 26 12:08:21 2014 +0100

    bmp: Fix reading of MS AMCap2 generated files
    
    Remove bogus number of colours check. I could not find any BMP readers
    that used this sort of checks and removing it makes MS AMCap2 generated
    files load properly.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=694950