xcf: Properly read image resolution

Summary:
QDataStream reads 64 bits when reading into a float unless you tell it to use SinglePrecision,
since floats in xcf are 32 bit, do that

Reviewers: cfeck, apol, vkrause

Reviewed By: vkrause

Subscribers: kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D24113
This commit is contained in:
Albert Astals Cid
2019-09-20 22:40:54 +02:00
parent 68bb1a0ee7
commit 7afaacb093

View File

@ -414,6 +414,7 @@ bool XCFImageFormat::loadImageProperties(QDataStream &xcf_io, XCFImage &xcf_imag
break;
case PROP_RESOLUTION:
property.setFloatingPointPrecision(QDataStream::SinglePrecision);
property >> xcf_image.x_resolution >> xcf_image.y_resolution;
break;