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 742689 - eog displaces BMP file
eog displaces BMP file
Status: RESOLVED OBSOLETE
Product: gdk-pixbuf
Classification: Platform
Component: loaders
git master
Other Linux
: Normal normal
: ---
Assigned To: gdk-pixbuf-maint
gdk-pixbuf-maint
Depends on:
Blocks:
 
 
Reported: 2015-01-10 09:49 UTC by Dimitri Papadopoulos
Modified: 2018-05-22 13:17 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
BMP file - created by ImageMagick if I recall correctly (32.08 KB, image/bmp)
2015-01-10 09:49 UTC, Dimitri Papadopoulos
  Details
screenshot of eog shifting the BMP file (47.74 KB, image/png)
2015-01-10 09:50 UTC, Dimitri Papadopoulos
  Details
screenshot of ImageMagick properly displaying the BMP file (24.30 KB, image/png)
2015-01-10 09:50 UTC, Dimitri Papadopoulos
  Details
tests: Add test for bug 742689 (55.18 KB, patch)
2016-12-30 12:24 UTC, Bastien Nocera
none Details | Review

Description Dimitri Papadopoulos 2015-01-10 09:49:11 UTC
Created attachment 294208 [details]
 BMP file - created by ImageMagick if I recall correctly

The attached BMP file is not properly displayed by eog. I have just noticed shotwell is broken as well. Gimp and ImageMagick display the BMP file properly - therefore the bug might be in some Gnome library.

Steps to Reproduce:
1. Download the attached file myoung.bmp.
2. Display it in eog. Notice how the image is shifted.
Comment 1 Dimitri Papadopoulos 2015-01-10 09:50:16 UTC
Created attachment 294209 [details]
 screenshot of eog shifting the BMP file
Comment 2 Dimitri Papadopoulos 2015-01-10 09:50:57 UTC
Created attachment 294210 [details]
 screenshot of ImageMagick properly displaying the BMP file
Comment 3 Felix Riemann 2015-01-10 15:15:23 UTC
Yes, this appears to be a bug in gdk-pixbuf reading the BMP file.
Comment 4 Felix Riemann 2015-01-10 15:29:09 UTC
I had a look at the file and it is a 16bpp-BMP which employs the RGB565 encoding.

The offset seems to be caused by 14 padding bytes (offset 0x42 - 0x4f) between the three bitfield masks and the actual image data. The BMP loader however seems to assume that the image data begins directly after the bitfield masks and thus interpretes the padding as the first 8 px of the last scanline. It ignores the offset field from the bitmap header which correctly specifies that the image data begins at offset 0x50.

Removing these padding bytes and adjusting the offset field in the header makes the file universally show correct for me (eog, gimp, ImageMagick).
Comment 5 Bastien Nocera 2016-12-30 10:46:10 UTC
Likely a dupe of bug 700952.
Comment 6 Bastien Nocera 2016-12-30 12:24:24 UTC
Created attachment 342620 [details] [review]
tests: Add test for bug 742689
Comment 7 Bastien Nocera 2016-12-30 12:27:13 UTC
I don't understand the state machine in BMP loader, but the problem is that BufferPadding is not handled in the "State->Compressed == BI_BITFIELDS" case in DecodeHeader().
Comment 8 GNOME Infrastructure Team 2018-05-22 13:17:54 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gdk-pixbuf/issues/49.