summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix tst_QImageReader::imageFormatBeforeReadAllan Sandfeld Jensen2017-06-181-1/+3
| | | | | | | | | | | The test was never loading images from a valid path, and thus never had any fullfill the base option which meant nothing was tested. Making it work revealed that the Format option on BMP formats doesn't predict semi-transparent files. Change-Id: I7035a0f63ebfbce940ce7a17a6142cf177480798 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* winrt: Fix tst_QImageReaderOliver Wolff2017-06-131-1/+1
| | | | | Change-Id: I3a7db49329d8f1677c17267f5878d5144ad37823 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* ppm/pgm image formats: fix reading 16bit and limited rangeEirik Aavitsland2017-03-021-0/+76
| | | | | | | | | | | | | The color values of ppm and pgm images can be either 8 or 16 bits. They can also be scaled to a smaller max value, and they can be expressed either binary or ascii. For some of these permutations, Qt's image handler lacked implementation or would decode the wrong color value. This commit fixes that. Task-number: QTBUG-18262 Task-number: QTBUG-35990 Change-Id: I7cf11c2366244f3a9b31c1a565a81e2658bc6a51 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-02-181-0/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | This also reverts commit 018e670a26ff5a61b949100ae080f5e654e7bee8. The change was introduced in 5.6. After the refactoring, 14960f52, in 5.7 branch and a merge, it is not needed any more. Conflicts: .qmake.conf src/corelib/io/qstandardpaths_mac.mm src/corelib/tools/qsharedpointer_impl.h tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp Change-Id: If4fdff0ebf2b9b5df9f9db93ea0022d5ee3da2a4
| * Crash fix: reject certain malformed bmp imagesEirik Aavitsland2016-02-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | A malformed bmp file header could specify a negative color table size. The bmp handler would then return a QImage that claimed to be valid, but actually was invalid, having an empty color table. This would cause crash later, e.g. when attempting to paint it. Change-Id: I7df7c40867557a82dbcee44c7de061226ff232c0 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com> Reviewed-by: Richard J. Moore <rich@kde.org>
* | Updated license headersJani Heikkinen2016-01-211-17/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | From Qt 5.7 -> tools & applications are lisenced under GPL v3 with some exceptions, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new GPL-EXCEPT header instead of LGPL21 one (in those files which will be under GPL 3 with exceptions) Change-Id: I42a473ddc97101492a60b9287d90979d9eb35ae1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into devSimon Hausmann2015-11-271-8/+23
|\| | | | | | | Change-Id: Ib43c6f126998eefcfed9a7c1f2bcbac8b4dd05ec
| * tst_QImageReader: Fix file handling.Friedemann Kleint2015-11-241-8/+23
| | | | | | | | | | | | | | | | | | | | Use a QTemporaryFile in readFromFileAfterJunk() instead writing to the current directory which might not have write permission. Enclose each call to QFile::open() in QVERIFY2() with error message. Change-Id: I3c5da31c6681a2396cee473cafe7d92c5c220de3 Reviewed-by: aavit <eirik.aavitsland@theqtcompany.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2015-11-231-0/+1
|\| | | | | | | | | | | | | | | Conflicts: src/corelib/kernel/qcoreapplication.cpp src/corelib/thread/qthread_unix.cpp Change-Id: Ia08d613c3f0bd08cb6dc3e3a57257207dfd4a099
| * Make the ppm image handler corrctly handle long comment linesEirik Aavitsland2015-11-191-0/+1
| | | | | | | | | | | | | | | | | | The ppm decoder used a fixed size buffer to discard comment lines, which would fail for comments longer than 100 characters. Task-number: QTBUG-49414 Change-Id: I92e910e025cf7584a6ff1c0e5b0e8a4ab281d479 Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
* | tests/auto/gui: Remove some placeholder formatting.Friedemann Kleint2015-10-191-3/+3
| | | | | | | | | | | | | | | | Use QByteArray/QString addition instead in loops and for test row names. Change-Id: I31adb60bdaf7ea243143a9244b6c4f66f38b189d Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2015-10-141-1/+1
|\| | | | | | | | | | | | | | | | | Conflicts: tests/auto/corelib/io/qfile/tst_qfile.cpp tests/auto/corelib/io/qprocess/tst_qprocess.cpp tests/auto/corelib/tools/qversionnumber/qversionnumber.pro Change-Id: Ia93ce500349d96a2fbf0b4a37b73f088cc505c6e
| * Tests: Always verify whether QTemporaryDir/File creation succeeded.Friedemann Kleint2015-09-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | Use QVERIFY2() with QTemporaryDir/File::errorString() consistently. Attempt to catch issues like the below warning and follow-up issues. QSYSTEM: tst_QFiledialog::clearLineEdit() QFileSystemWatcher: FindNextChangeNotification failed for "C:\Users\qt\_____aaaaaaaaaaaaaaaaaaaaaa" (Access is denied.) Task-number: QTBUG-47370 Change-Id: I58a6e87c502627e976efa62ad73c912f3b2d49fa Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
* | Tests: Fix single-character string literals.Friedemann Kleint2015-10-131-1/+1
|/ | | | | | | Use character literals where applicable. Change-Id: I1a026c320079ee5ca6f70be835d5a541deee2dd1 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* tests/auto/gui: Replace Q[TRY]_VERIFY(a == b) by Q[TRY]_COMPARE(a, b).Friedemann Kleint2015-07-311-4/+4
| | | | | | | | | | | | - Replace Q[TRY]_VERIFY(pointer == 0) by Q[TRY]_VERIFY(!pointer). - Replace Q[TRY]_VERIFY(smartPointer == 0) by Q[TRY]_VERIFY(smartPointer.isNull()). - Replace Q[TRY]_VERIFY(a == b) by Q[TRY]_COMPARE(a, b) and add casts where necessary. The values will then be logged should a test fail. Change-Id: I624deb320c378c18a29b3707f48583d53bfd5186 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-111-7/+7
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.4' into devSimon Hausmann2014-12-181-1/+1
|\ | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qglobal.h src/platformsupport/platformcompositor/qopenglcompositor.cpp src/platformsupport/platformcompositor/qopenglcompositorbackingstore.cpp tests/auto/gui/kernel/qwindow/tst_qwindow.cpp Change-Id: I5422868500be695584a496dbbbc719d146bc572d
| * Change bugreports.qt-project.org -> bugreports.qt.ioAlex Blasche2014-12-181-1/+1
| | | | | | | | | | | | | | The Qt bug tracker URL changes as part of the qt.io transition Change-Id: Icb4ab198943b93639b5e3a8d99262303785c6459 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.4' into devOswald Buddenhagen2014-09-291-19/+11
|\| | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qbytearray.cpp src/gui/image/qimage.cpp src/gui/image/qppmhandler.cpp src/gui/kernel/qguiapplication.cpp src/gui/painting/qpaintengine_raster.cpp Change-Id: I7c1a8e7ebdfd7f7ae767fdb932823498a7660765
| * Update license headers and add new license filesMatti Paaso2014-09-241-19/+11
| | | | | | | | | | | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* | Add Grayscale8 and Alpha8 formats to QImage and drawingAllan Sandfeld Jensen2014-09-171-2/+2
|/ | | | | | | | | | | | Extend the QImage format with two 8-bit grayscale and alpha formats. These formats have the advantage over Indexed8 that they have simpler conversion and can be rendered to by the raster engine. [ChangeLog][QtGui][QImage] Added support grayscale and alpha 8-bit formats which can also be rendered to. Change-Id: I4343c80a92a3dda196aa38d0c3ea251b094fc274 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* Remove qSort usages from gui testsSergio Ahumada2014-02-201-2/+4
| | | | | | | | QtAlgorithms is getting deprecated, see http://www.mail-archive.com/development@qt-project.org/msg01603.html Change-Id: Idf0fc471f8ab7b30a097d8faf93c93d5ebbb03ef Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-02-141-0/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/concurrent/doc/qtconcurrent.qdocconf src/corelib/doc/qtcore.qdocconf src/corelib/global/qglobal.h src/dbus/doc/qtdbus.qdocconf src/dbus/qdbusmessage.h src/gui/doc/qtgui.qdocconf src/gui/image/qimagereader.cpp src/network/doc/qtnetwork.qdocconf src/opengl/doc/qtopengl.qdocconf src/opengl/qgl.h src/plugins/platforms/windows/qwindowswindow.cpp src/printsupport/doc/qtprintsupport.qdocconf src/sql/doc/qtsql.qdocconf src/testlib/doc/qttestlib.qdocconf src/tools/qdoc/doc/config/qt-cpp-ignore.qdocconf src/widgets/doc/qtwidgets.qdocconf src/xml/doc/qtxml.qdocconf Change-Id: Ie9a1fa2cc44bec22a0b942e817a1095ca3414629
| * Fixed crash in image reader when reading certain BMP files.Samuel Rødal2013-02-061-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the high bit in a mask is set, for instance if the mask is 0xff000000, and we shift it to the right by 24 positions, since the mask was not declared as unsigned we ended up with a mask value of 0xffffffff. We then add 1 to this value and divide by the result, causing a division by zero crash. The masks need to be declared unsigned to prevent sign bit extension when shifting right. Task-number: QTBUG-29194 Change-Id: I79260344cebfbdd3ea86416a9c734dca76517999 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* | Merge "Merge remote-tracking branch 'origin/stable' into dev" into ↵Frederik Gladhorn2013-01-231-1/+1
|\| | | | | | | refs/staging/dev
| * Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | | | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | QImage plugins should report supported mime typesAllan Sandfeld Jensen2013-01-231-0/+21
|/ | | | | | | | | | Introduces the methods QImageReader::supportedMimeTypes and QImageWriter::supportedMimeTypes which corresponds to the similar supportedImageFormats methods, except they return lists of MIME types. Task-number: QTBUG-28177 Change-Id: Ibb0e264a12eaf972a8bfd6bd891dcd9f89efd085 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Gui: Remove declaration of built-in and automatic metatypes.Stephen Kelly2013-01-041-7/+0
| | | | | | | | These types are either built-in or 'automatically declared' and so don't need to be explicitly declared as metatypes. Change-Id: I95b8b4b674e85b2b3c374931f6231d60f35be984 Reviewed-by: David Faure <david.faure@kdab.com>
* Fix GIF image decoding: do not zero transparent pixelsaavit2012-11-091-0/+9
| | | | | | | | | | | | | | For the special transparent color index, the decoder would skip writing anything out (thus leaving the pixels at 0 rgba value). Although correct for later frames, for the initial frame this would loose the color information for such pixels (which one otherwise could have made visible e.g. by converting then image to an alpha-less image format). Change-Id: I316cefce8f21797feedebfbf98296ad84eaa4b99 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com> (cherry picked from qt/c309d424f45dc0e7b62fbbbabf20dbfe355f48a7) Reviewed-by: aavit <eirik.aavitsland@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-24/+24
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* QJpegHandler: add an embedded text supportKonstantin Ritt2012-05-161-21/+35
| | | | | | | | | | | texts for the textKeys are stored each in a separate COM(ment) section so that the maximum text's size is almost 65KB Task-number: QTBUG-10568 Task-number: QTBUG-111 Change-Id: I7d693741e10e5d78d497cb0af448160077350bb2 Reviewed-by: aavit <qt_aavit@ovi.com>
* Change remaining uses of {to,from}Ascii to {to,from}Latin1 [QtGui]Thiago Macieira2012-05-041-2/+2
| | | | | | | | | | This operation should be a no-op anyway, since at this point in time, the fromAscii and toAscii functions simply call their fromLatin1 and toLatin1 counterparts. Task-number: QTBUG-21872 Change-Id: I2850033159508ebb1ff7564e15b99a146dbee94c Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Implement inline downscaling in png reader, to save memoryaavit2012-04-271-1/+2
| | | | | | | | | Instead of allocating and reading the entire image and then scaling it down, this code reads only one line at a time and scales it on the fly. Change-Id: I61fde307146c11dcd90ca617cc2e7f85dd3b66c4 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* tst_qimagereader: does not depend on QtWidgetsDebao Zhang2012-03-091-1/+0
| | | | | | | | Both tst_qimagereader.cpp and tst_qimagewriter.cpp do not depend on QtWidgets. Change-Id: I7e8b31c23db203c44ccb4cd4e8e747d18c5d7ed7 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Change bugreports.qt.nokia.com -> bugreports.qt-project.orgSergio Ahumada2012-03-021-1/+1
| | | | | Change-Id: Ia795098f24cf358b15067f54cd08dff0bd792bc5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix build of QImageReader tests with QT_USE_QSTRINGBUILDER.Stephen Kelly2012-02-291-1/+1
| | | | | Change-Id: I789d99d0741bc178d2d7fd82558edc684eb6daf8 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Eliminate duplicate data row names in gui autotests.Jason McDonald2012-02-141-1/+0
| | | | | Change-Id: I1b39a7d13399ea8d47369203e9617810a34c0097 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Moving tiff image format support and libtiff out of qtbaseaavit2012-01-311-160/+0
| | | | | | | | | | The tiff plugin and bundled libtiff is moving to the qtimageformats project on Gerrit. Task-number: QTBUG-23887 Change-Id: I4c848232fdccddd7e7f54215f9eaa78dc4c3a53d Reviewed-by: Kent Hansen <kent.hansen@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-301-1/+1
| | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: I311e001373776812699d6efc045b5f742890c689 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove support for the MNG file format and the bundled libmngaavit2012-01-251-42/+1
| | | | | | | | | | | | | The MNG file format is generally abandoned, and libmng has been unmaintained for several years. The MNG plugin and bundled libmng has been moved to the qtimageformats project on Gerrit. Task-number: QTBUG-21869 Change-Id: I946432347014ffde2b72307a5f8b166ca5553602 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Update contact information in license headers.Jason McDonald2012-01-231-1/+1
| | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I431bbbf76d7c27d8b502f87947675c116994c415 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-051-1/+1
| | | | | Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Fix qimagereader, qmovie and qmake unittest to work in shadow build.Kurt Korbatits2011-12-151-2/+2
| | | | | | | Changed to use QFINDTESTDATA and TESTDATA. Change-Id: I8684bc191cf8ffb8b531456e32047d582ebc018c Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* QImageReader-test: Make more verbose, use QTemporaryDir.Friedemann Kleint2011-12-131-9/+46
| | | | | | | | | - Add some QVERIFY to check for isNull(). - Use QTemporaryDir to avoid spurious failures in the format extension-ignore test (cannot copy to '/tmp/black.jpg'). Change-Id: Ia57ea4daa6b8686d1111c9c27a47666265fa9781 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Fix failing unit tests.Sarah Smith2011-12-131-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | The test that was failing was the readFromDevice one - where the extension is not known. Looks as though image detection is required in a positive way, that is it is not enough to say I think I can read this file, and then fail if the format is "corrupt", you must be certain that the file was intended to be that format. In the case of TGA the original format has no magic byte header, and no consistent way to check if it really is a TGA file. With 2.0 the footer was added at the end, so that can be checked for confirming the file is TGA. However rejecting files which do not have this means that old TGA files will not be read. On a quick survey TGA files that have been used in applications so far all seem to be 2.0 TrueVision, so for now, lets just reject earlier files and see how it goes. Also add reading the tga test file to the readFromDevice test. (cherry picked from commit 665bc3951709f0d726cb82501a5bca684f3347a5) Change-Id: I665bc3951709f0d726cb82501a5bca684f3347a5 Reviewed-by: Sarah Jane Smith <sarah.j.smith@nokia.com>
* Remove TESTED_CLASS/TESTED_FILES comments from tests.Jason McDonald2011-12-061-2/+0
| | | | | | | | | These comments were mostly empty or inaccurate. Appropriate naming of tests and appropriate placement of tests within the directory tree provide more reliable indicators of what is being tested. Change-Id: Ib6bf373d9e79917e4ab1417ee5c1264a2c2d7027 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* qtbase tests: Fix some warningsFriedemann Kleint2011-11-211-1/+1
| | | | | | | | - Fix warnings about QAtomicPointer/Int usage - Fix some gcc 4.6 warnings about assigned/unused variables Change-Id: Ib4dbf9110f0dad93ad48e97278310f05fad3a82a Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Don't rely on PlatformQuirks in qimagereader testJason McDonald2011-11-041-6/+3
| | | | | | | | | | | | | | The PlatformQuirks header is, by its author's own admission, based on "very bad assumptions", those being that only Meego has quirks. The assumption that only Meego has versions of libjpeg and libpng with rounding errors is not a good assumption. Change the test to be a little tolerant of rounding error regardless of the platform, at least until there's a reliable way to tell which libjpeg/libpng versions have rounding errors. Change-Id: Id2be5cc54739249b615bf3307ee1850c0a5c06b3 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove SkipMode parameter from QSKIP calls.Jason McDonald2011-10-211-1/+1
| | | | | | | | | The previous commit removed SkipMode from the testlib APi. This commit removes the parameter from all calls to QSKIP. Task-number: QTBUG-21851, QTBUG-21652 Change-Id: I21c0ee6731c1bc6ac6d962590d9b31d7459dfbc5 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove Symbian-specific code from tests.Jason McDonald2011-09-291-9/+0
| | | | | | | | | Symbian is not a supported platform for Qt5, so this code is no longer required. Change-Id: I1172e6a42d518490e63e9599bf10579df08259aa Reviewed-on: http://codereview.qt-project.org/5657 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>