Bug 362484 - bad dotsPerMeter information for XCF files
Summary: bad dotsPerMeter information for XCF files
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kimageformats
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Other
: NOR normal
Target Milestone: ---
Assignee: Alex Merry
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-30 00:51 UTC by Andrius
Modified: 2019-09-21 15:15 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.63
Sentry Crash Report:


Attachments
Sample XCF file (743 bytes, image/x-xcf)
2016-04-30 00:52 UTC, Andrius
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrius 2016-04-30 00:51:57 UTC
Images read through XCF plugin currently return weird values for QImage::dotsPerMeterX and QImage::dotsPerMeterY, e.g.:
DPM X:  -2147483648
DPM Y:  3937

example image attached (generated by GIMP 2.8)


Reproducible: Always

Steps to Reproduce:
1. Read an XCF image using QImageReader
2. get QImage::dotsPerMeterX() and QImage::dotsPerMeterY() values

Actual Results:  
DPM X:  -2147483648
DPM Y:  3937

Expected Results:  
DPM X:  72
DPM Y:  72
Comment 1 Andrius 2016-04-30 00:52:23 UTC
Created attachment 98691 [details]
Sample XCF file
Comment 2 Andrius 2016-04-30 00:54:37 UTC
just an amendment, for this example the expected results are:

DPM X: 2834
DPM Y: 2834
Comment 3 Christoph Feck 2016-04-30 03:51:23 UTC
From quickly checking the code, the QDataStream probably needs to use setFloatingPointPrecision(SinglePrecision), otherwise all floats are read in double precision.