From f807a6de2c14714ffe0fdddac54ef41325613764 Mon Sep 17 00:00:00 2001 From: Serge Lysenko Date: Mon, 31 Aug 2015 19:43:45 +0300 Subject: Fix QImageReader::size() to return correct size for .ico files. According to MSDN, the zero value of ICONDIRENTRY bHeight and bWidth fields mean a maximum icon size 256 pixels. So QtIcoHandler::option() should return 256 instead of 0 pixels for such icons. Also there is fixed wrong seek offset at the second call on this method. http://blogs.msdn.com/b/oldnewthing/archive/2010/10/18/10077133.aspx Task-number: QTBUG-48103 Change-Id: I99f0c9720fd58889045b0c73c51498f2065b0b91 Reviewed-by: Friedemann Kleint Reviewed-by: aavit --- tests/auto/gui/image/qicoimageformat/tst_qicoimageformat.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tests/auto/gui/image/qicoimageformat') diff --git a/tests/auto/gui/image/qicoimageformat/tst_qicoimageformat.cpp b/tests/auto/gui/image/qicoimageformat/tst_qicoimageformat.cpp index d2fae0e5e3..bff762fd04 100644 --- a/tests/auto/gui/image/qicoimageformat/tst_qicoimageformat.cpp +++ b/tests/auto/gui/image/qicoimageformat/tst_qicoimageformat.cpp @@ -324,6 +324,11 @@ void tst_QIcoImageFormat::pngCompression() QImage image; reader.jumpToImage(index); + + QSize size = reader.size(); + QCOMPARE(size.width(), width); + QCOMPARE(size.height(), height); + reader.read(&image); QCOMPARE(image.width(), width); -- cgit v1.2.3