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 332501 - Image dpi resolution changes when saved to .bmp file format
Image dpi resolution changes when saved to .bmp file format
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: Plugins
2.2.x
Other Windows
: Normal normal
: 2.2
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2006-02-25 00:03 UTC by Casey Stanley
Modified: 2008-01-15 13:05 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Casey Stanley 2006-02-25 00:03:12 UTC
Windows XP SP 2
Gimp 2.2.10
GTK+ 2.8.9

Sorry if this is a duplicate, i simply couldn't find a duplicate bug report. ^^;

While not being a critical bug, I've noticed still that if you save an image as a .bmp file, the dpi resolution will always change itself by 0.01 or so.
As an image file example, instead of keeping it's 96.00 dpi like it should, it'll be saved as 95.9866 dpi.
Re-sizing it back to 96.00 and re-saving doesn't seem to work, is this behaviour normal for bmp files?
Comment 1 Michael Schumacher 2006-02-26 02:32:54 UTC
Is the BMP format able to save the ppi value at all? Would help if you could look this up in the specs.
Comment 2 Casey Stanley 2006-02-26 21:28:58 UTC
It does appear to save the ppi value, but not correctly.
Have also noticed that the print size changes slightly in the same manner.

I've done a test and saved the .bmp file as an .xcf after re-scaling the dpi back to 96.00, the .xcf file matains the correct dpi so perhaps there's either something wrong with the .bmp save or is something that's supposed to occur with that format.

However as i've also recently opened up .bmp files that wern't saved in Gimp (the ones pre-provided with win xp) to find that all their dpi and print size info to be strangely of the same nature. (71.9836 x 71.9836 dpi)

So one guess is it seems possible that it is properly saved, but either the info window's incorrectly reading it or the file's changed upon opening. (i doubt the file's changed as i'd get a warning to save if it was)

.bmp files are opened without any noticable image errors though, so maybe it could be left as trivial/wontfix to figure out the reason of the resolution and print size change. Though I personally found it to be a lil strange. ^^;

Same image comparisons taken from the Info window:

if saved as an .xcf file:
Pixel dimensions:	1024 x 723 pixels
Print size:	10.667 x 7.531 inches
Resolution:	96 x 96 dpi

if saved as an .bmp file:
Pixel dimensions:	1024 x 723 pixels
Print size:	10.668 x 7.532 inches
Resolution:	95.9866 x 95.9866 dpi
Comment 3 Simon Budig 2006-02-26 21:57:12 UTC
This is a rounding error. Gimp uses DPI and BMP uses pixels/meter.

The BMP plugin computes 96.0 / 2.54 * 100 = 3779.53 which gets casted to a long int (3779).

The calculation in the other direction results in 3779.0 / 100 * 2.54 = 95.9866 dpi.

There is nothing we can do to fix this exactly, since BMP always stores integers, however, it makes sense to round properly when saving the BMP.
Change committed to CVS:

2006-02-26  Simon Budig  <simon@gimp.org>

        * plug-ins/bmp/bmpwrite.c: properly round the resolution entry.
        Fixes bug #332501.