From 7afaacb09384830b3239dd4291347550b04828b9 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Fri, 20 Sep 2019 22:40:54 +0200 Subject: [PATCH] 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 --- src/imageformats/xcf.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/imageformats/xcf.cpp b/src/imageformats/xcf.cpp index d84ec48..b6dc0b2 100644 --- a/src/imageformats/xcf.cpp +++ b/src/imageformats/xcf.cpp @@ -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;