summaryrefslogtreecommitdiffstats
path: root/src/gui/image
Commit message (Collapse)AuthorAgeFilesLines
* Make sure QIconLoader is always initializedKevin Ottens2013-04-222-8/+5
| | | | | | | | | | | | | | | | | It is necessary to properly initialize the icon loader in all case. Otherwise some calls might give wrong results if a platform theme plugin is involved. For instance, we might miss the actual theme name reported by the platform theme, eg it's what happen with QStyle::standardPixmap if no one created a QIcon before its first call. Also clean up the accesses to the global static and have only QIconLoader::instance() use it. All other call go through the static method. This way only instance() needs to call ensureInitialized(), definitely safer and looks cleaner to me. Change-Id: Id3ea6816edd5a65586004f69464960abc3602cf8 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* QIcon: Added a move constructor.Keith Gardner2013-04-081-0/+4
| | | | | Change-Id: Idedb935352bf8a0cd7d4293f7b8530d5b9b17616 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QImage: Added a move constructor.Keith Gardner2013-04-081-0/+5
| | | | | | | [QTBUG-30517] Change-Id: I173de783ef8113ab10fb553cc82ef60904a15400 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix missing devicePixelRatio propagation on copy.Morten Johan Sørvig2013-03-292-3/+6
| | | | | Change-Id: I0cb541fe8a92b7a7c159e0a6e5036baf43185a93 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* Load "@2x" images on high-dpi "retina" systems.Morten Johan Sørvig2013-03-281-0/+11
| | | | | | | | | Check for the existence of a "@2x" file when adding an image to QIcon. For example, adding "foo.png" will also add "foo@2x.png" if that file exists. Change-Id: If32a3446cf56ca0828de17f6a361091e4c874f26 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* Make QIcon generate high-dpi pixmaps.Morten Johan Sørvig2013-03-233-7/+117
| | | | | | | | | | | | | | | | | | | | | | QIcon::pixmap() can now return pixmaps that are larger than the requested size, This is a behavior change that may require updating existing application code, and is enabled by setting Qt::AA_UseHighDPIIamges. Add new pixmap() and actualSize() overloads that take a window pointer. For 100% correctness you want to target pixmap generation to a specific window, in case the system has a mix of normal and high-dpi displays. (The non-window versions uses QGuiApplication:: devicePixelRatio(), which returns the ratio for the "best" display on the system.) actualSize now returns the size in device-independent pixels - not the pixmap pixel size. This matches its intended use case which is layout calculations. Change-Id: I2eefc4ed4aa48b036a7019446694e56213070efa Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* Merge branch 'dev' into stableOswald Buddenhagen2013-03-2024-101/+154
|\ | | | | | | | | | | | | | | | | | | | | | | This starts Qt 5.1 release cycle Conflicts: src/gui/text/qfontdatabase.cpp src/gui/text/qharfbuzz_copy_p.h src/widgets/kernel/qapplication.cpp src/widgets/kernel/qcoreapplication.cpp Change-Id: I72fbf83ab3c2206aeea1b089428b0fc2a89bd62b
| * Make sure that we #include qconfig.h before testing for features.Thiago Macieira2013-03-191-0/+2
| | | | | | | | | | | | | | | | | | | | | | This is mandatory in public headers (qiodevice.h, qopengl*, etc.), but it's a good idea even in private headers, in case someone includes that header first somewhere. In particular, all platformsupport API is private. Change-Id: If287baa5d9ed14e93c1666efa0e6332c4c1cd9a4 Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
| * Whitespace cleanup: remove trailing whitespaceAxel Waggershauser2013-03-163-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove all trailing whitespace from the following list of files: *.cpp *.h *.conf *.qdoc *.pro *.pri *.mm *.rc *.pl *.qps *.xpm *.txt *README excluding 3rdparty, test-data and auto generated code. Note A): the only non 3rdparty c++-files that still have trailing whitespace after this change are: * src/corelib/codecs/cp949codetbl_p.h * src/corelib/codecs/qjpunicode.cpp * src/corelib/codecs/qbig5codec.cpp * src/corelib/xml/qxmlstream_p.h * src/tools/qdoc/qmlparser/qqmljsgrammar.cpp * src/tools/uic/ui4.cpp * tests/auto/other/qtokenautomaton/tokenizers/* * tests/benchmarks/corelib/tools/qstring/data.cpp * util/lexgen/tokenizer.cpp Note B): in about 30 files some overlapping 'leading tab' and 'TAB character in non-leading whitespace' issues have been fixed to make the sanity bot happy. Plus some general ws-fixes here and there as asked for during review. Change-Id: Ia713113c34d82442d6ce4d93d8b1cf545075d11d Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
| * Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-03-051-0/+4
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure qmake/generators/mac/pbuilder_pbx.cpp src/corelib/kernel/qtimerinfo_unix.cpp src/plugins/platforms/cocoa/qcocoabackingstore.mm src/plugins/platforms/cocoa/qcocoawindow.mm src/plugins/platforms/windows/qwindowswindow.cpp src/plugins/platforms/xcb/qglxintegration.cpp Change-Id: I8d125fe498f5304874e6976b53f588d3e98a66ac
| * | Let QPlatformTheme decide which engine QIcon::fromTheme usesKevin Ottens2013-02-191-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By default we still use QIconLoaderEngine but now platform theme plugins have the opportunity to override that. It is in particular planned to be used in a WIP platform theme plugin for KDE sessions. Change-Id: I07a82dc91daea44709b3a790f3f6e2a7a090d108 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: David Faure (KDE) <faure@kde.org> Reviewed-by: Samuel Rødal <samuel.rodal@digia.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
| * | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-02-181-1/+4
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/widgets/styles/qmacstyle_mac.mm Change-Id: If8326db9e7da3cbf45dbf7475fdff9915c7723b1
| * \ \ Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-02-149-22/+27
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | | | Fix segfault when setting a device-pixel-ratio on a null-QPixmapTor Arne Vestbø2013-02-091-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: If3680766a50d5cf78889822d740c9472123191a7 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
| * | | | Merge "Merge remote-tracking branch 'origin/stable' into dev" into ↵Frederik Gladhorn2013-01-293-7/+5
| |\ \ \ \ | | | | | | | | | | | | | | | | | | refs/staging/dev
| | * \ \ \ Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-01-283-7/+5
| | |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | Change-Id: I12b4d8b99bdccae53b1a978cd6eb8f4ac6fb3c76
| * | | | | | Remove QT_{BEGIN,END}_HEADER macro usageSergio Ahumada2013-01-2914-56/+0
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The macro was made empty in ba3dc5f3b56d1fab6fe37fe7ae08096d7dc68bcb and is no longer necessary or used. Discussed-on: http://lists.qt-project.org/pipermail/development/2013-January/009284.html Change-Id: Id2bb2e2cabde059305d4af5f12593344ba30f001 Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com> Reviewed-by: hjk <hjk121@nokiamail.com>
| * | | | | Merge "Merge remote-tracking branch 'origin/stable' into dev" into ↵Frederik Gladhorn2013-01-2362-62/+62
| |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | refs/staging/dev
| | * \ \ \ \ Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-01-2262-62/+62
| | |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qsavefile_p.h src/corelib/tools/qregularexpression.cpp src/gui/util/qvalidator.cpp src/gui/util/qvalidator.h Change-Id: I58fdf0358bd86e2fad5d9ad0556f3d3f1f535825
| * | | | | | | QImage plugins should report supported mime typesAllan Sandfeld Jensen2013-01-234-35/+127
| |/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | | | | | Ensure raster pixmap cache key is the same as that of pixmap.toImage()Michael Brasser2013-01-113-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is done to support texture uploads in an image provider. It ensures we can load the texture using QImage in the image provider, and when it is later painted as a pixmap, the cacheKey will be identical (assuming no format conversion was required). Change-Id: I54229511ed91ce5430cc478af5aff0d96685a2da Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* | | | | | | Merge remote-tracking branch 'origin/release' into stableFrederik Gladhorn2013-03-081-2/+3
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: tests/auto/opengl/qgl/tst_qgl.cpp Change-Id: I3c601351c984c1f4b00478d3c47ac9eeb021e892
| * | | | | | | Fixed potential access violation in QPixmap::copy() for <32 bit pixmaps.Samuel Rødal2013-03-061-2/+3
| | |_|_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QImage is supposed to maintain the invariant that each scan-line begins on a 4-byte boundary, so we need to verify that this is the case before using the optimized path of short-cutting QImage::copy() by referencing the source image's bits directly. Task-number: QTBUG-14766 Change-Id: I0a178aeb2f34cc64f98deae9470b55b5c53fcb06 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* / | | | | | QIcon: ensure that QIconLoader is initializedDmitry Shachnev2013-03-061-0/+1
|/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make sure that QIconLoader is initialized when QIcon::themeName() is called. Otherwise, themeName() may return the wrong value. Change-Id: I54621e31da24bdbe745e7d6ae6a1d58cb4190cd7 Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* | | | | / Fix reentrancy problem in image readingaavit2013-02-201-0/+4
| |_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There were race conditions when accessing the plugin factory and the image reader plugins from different threads; ref QTBUG-29281. Added a mutex lock to avoid. Change-Id: Ic1a3b6cbaf5603f1bcf7025b58247a9a3f6d08a9 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* | | | | Fixed crashes when using QImage in combination with QCoreApplication.Samuel Rødal2013-02-141-1/+4
| |_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As long as fonts weren't used we supported using QImage in combination with QCoreApplication in 4.x, and there's no reason we can't continue doing so. Task-number: QTBUG-29643 Change-Id: I2cf351d3c93f1c175bbf624e45024d39ab913111 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* | | | Fixed QPixmapCache associating path with wrong QPixmap.Samuel Rødal2013-02-121-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QPixmap::load() would not detach, so multiple paths could get associated with the same QPixmap, causing the wrong pixmap to be shown. Task-number: QTBUG-29639 Change-Id: I064dd6a9611b5996853bec9fb20b6224a0adcf62 Reviewed-by: aavit <eirik.aavitsland@digia.com>
* | | | Fixed crash in image reader when reading certain BMP files.Samuel Rødal2013-02-061-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | | doc: Fix QPixmapCache size default value in docJulien Brianceau2013-02-051-9/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QPixmapCache size default value is always 10 Mb since change I2ac33765 Change-Id: I28c99433948b07e9c84d0afda7aa5a8f49d2cd18 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* | | | Merge branch 'release' into stableSergio Ahumada2013-01-311-1/+1
|\ \ \ \ | | | | | | | | | | | | | | | Change-Id: If3aa1b7ed75082eff6e9761ad82c83691135ed60
| * | | | Fix some more old references and links to NokiaSergio Ahumada2013-01-281-1/+1
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-28156 Change-Id: I9ba0d6f1e92103219bec1e61e716b6b2f269a8ad Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* | | | Clean up logical dpi for QImage.Morten Johan Sørvig2013-01-312-8/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Revert to the pre highdpi-patch behaviour. Before, both physical and logical DPI would be based on the dpmx/dpmy variables, which could be changed with setDotsPerMeter(). The highdpi patch introduced separate ldpmx/ldpmy variables, which were not changed by setDotsPerMeter(). This broke when loading images: setDotsPerMeter would be called but the logical dpi would not change. Remove ldpmx/ldpmy. Keep scaling the physical dpi by the devicePixelRatio, which will be set to 1 by default. Task-number: QTBUG-29187 Change-Id: I0d6f5f3b8efae5fb1adc0a50b22a5da78324a282 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* | | | Exclude BMP from supported formats if it disabled by Qt buildPoul Sysolyatin2013-01-292-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If Qt build without BMP support, we need exclude this format from output of QImageWriter::supportedImageFormats() and QImageReader::supportedImageFormats() methods. Task-number: QTBUG-27028 Change-Id: I44e8956247066c0836b1ff7bf9a1f356fe568af1 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* | | | Added 'jpeg' to QImageReader::supportedImageFormats()Poul Sysolyatin2013-01-291-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When Qt build statically result of QImageReader::supportedImageFormats() must contain 'jpeg' and 'jpg' if JPEG support enabled. Task-number: QTBUG-29222 Change-Id: I94d731c2d1e2ede148e2e5261a310a840a1d5523 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* | | | Doc, Qt GUI: Fix "no \inmodule command" warningsSze Howe Koh2013-01-282-0/+2
| |_|/ |/| | | | | | | | | | | | | | | | | | | | Explicitly add "\inmodule QtGui" to Qt GUI classes Change-Id: Id641c1dc98770fbd994cecc375ca46c01f083236 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* | | Doc: Fix module name formatSze Howe Koh2013-01-253-7/+5
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Follow the conventions at http://qt-project.org/wiki/Spelling_Module_Names_in_Qt_Documentation QtCore -> Qt Core QtDBus -> Qt D-Bus QtDesigner -> Qt Designer QtGui -> Qt GUI QtImageFormats -> Qt Image Formats QtNetwork -> Qt Network QtPrintSupport -> Qt Print Support QtScript -> Qt Script QtSql -> Qt SQL QtSvg -> Qt SVG QtTest -> Qt Test QtWebKit -> Qt WebKit QtWidgets -> Qt Widgets QtXml -> Qt XML QtConcurrent -> Qt Concurrent (partial) QtQuick -> Qt Quick (partial) Also, distinguish between "module" and "library" Change-Id: Icb8aa695ae60b0e45920b0c8fce4dc763a12b0cd Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* | Update copyright year in Digia's license headersSergio Ahumada2013-01-1862-62/+62
|/ | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Replace macro qdoc with Q_QDOCDebao Zhang2013-01-081-1/+1
| | | | | | | | Both qdoc and Q_QDOC are used in source code, which looks not good. Change-Id: I4f3a71670278b0758d92bfa5db086a07e1b1acfd Reviewed-by: hjk <qthjk@ovi.com> Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* Make QImage::mirrored() propagate devicePixelRatioMorten Johan Sorvig2013-01-021-0/+1
| | | | | Change-Id: I2dfeacc941cb411a7ec6752f745fed9d6345ed8a Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Make qtbase compile with QT_NO_IMAGEFORMATPLUGINv5.0.0-rc1Tasuku Suzuki2012-12-054-24/+33
| | | | | | Change-Id: I1fef96481fa902cfd9de63fa814f70412eee4d15 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: aavit <eirik.aavitsland@digia.com>
* Fix warning about cast from ASCII.Friedemann Kleint2012-12-041-1/+1
| | | | | Change-Id: Icc251a8d26db022077c84ff2d0911868b56c9fd6 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* Basic high-dpi "retina" support for Qt 5.Morten Johan Sørvig2012-12-0111-11/+156
| | | | | | | | | | | | | | | | | | | | | | | | | | Bring Qt 5 on par with Qt 4, prepare for more comprehensive support later on. Introduce device independent pixels (dips), device pixels, and devicePixelRatio. Add high-dpi support to QPainter, QGLWidget, the cocoa platform plugin, mac and fusion styles. Dips are similar to CSS pixels, Apple points and Android density-independent pixels. Device pixels are pixels in the backing store/physical pixels on screen. devicePixelRatio is the ratio between them, which is 1.0 on standard displays and 2.0 on "retina" displays. New API: QImage::devicePixelRatio() and setDevicePixelRatio() QPixmap::devicePixelRatio() and setDevicePixelRatio() QWindow::devicePixelRatio() QScreen::devicePixelRatio() QGuiApplicaiton::devicePixelRatio() Change-Id: If98c3ca9bfdf0e1bdbcf7574cd5b912c9ff63856 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* QJpegHandler: err should be set before jpeg_create_decompress()Elvis Lee2012-11-211-2/+3
| | | | | | | | | | If ERREXIT2 is called in jpeg_create_decompress(), SIGSEGV occurs with no error message. ERREXIT2 macro uses jpeg_compress_struct.err to handle error case. Change-Id: I8517a4d6f6e6aa4c1c59cd1aaea435554cca7ac3 Reviewed-by: Jørgen Lind <jorgen.lind@gmail.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Fix GIF image decoding: do not zero transparent pixelsaavit2012-11-091-9/+6
| | | | | | | | | | | | | | 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>
* Save grayscale palleted images to grayscale pngSergey Borovkov2012-11-091-4/+7
| | | | | | | | | | While Qt does not support grayscale images explicitly it makes sense to save palleted images to grayscale png when possible for better compression and compatibility as opening and saving grayscale images now converts them to palleted Change-Id: Iab7c5a5a9d24b9352f5a7bafe04824a97d2463d9 Reviewed-by: aavit <eirik.aavitsland@digia.com>
* Remove some dead code in switch statementsSergio Ahumada2012-10-291-10/+0
| | | | | | | | | | Following the Code Style described in http://qt-project.org/wiki/Qt_Coding_Style#e289ee44592e9c32d4212069f0806daf There is no need for a 'break' after a 'return'. Change-Id: I1eca350391a7e4e14e504d60b24b69982cc5ac47 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove unnecessary call to png_set_sBit when writing png filesSergey Borovkov2012-10-261-7/+0
| | | | | | | | | | | According to libpng documentation - PNG files reduce possible bit depths to 1, 2, 4, 8, and 16. If data is of another bit depth, it's possible to write an sBIT chunk into the file so that decoders can recover the original data if desired. Since we hardcode depth to 8 there is no need to call png_set_sBit Change-Id: I8e3941675019b920051775128ff4cf2bf1ca7c4a Reviewed-by: aavit <eirik.aavitsland@digia.com>
* Invalidate old QImage data if load()/loadFromData() has failedKonstantin Ritt2012-10-103-43/+42
| | | | | | | | | | This guarantees one will never get `!img.isNull()` after load()/loadFromData() has failed, even if the image was not null before. Apply the same fix to QPixmap and QPicture. Change-Id: Ida1ad6a6f0fc830df8e75ada0c163fc2d3360dea Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Scale icons returned by QIcon::fromTheme.David Sansome2012-10-101-2/+8
| | | | | | | | | | | | | | | | | The icon engine behind icons that are loaded from QIcon::fromTheme does not scale any pixmaps that it returns. When using an icon theme with an incomplete set of icons (for example, only a "128x128" folder), QIcon::pixmap will always return 128x128 pixmaps even if you ask for one of size 22x22. This is contrary to the QIcon::pixmap documentation that says "The pixmap might be smaller than requested, but never larger." This patch uses the same code that is in the main QIcon class in the PixmapEntry QIconLoaderEngineEntry to scale pixmaps if they are too big. Change-Id: Ic25a3628ac82cfb899574245f658490a2dd49d54 Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* Fix DIB image reading.Friedemann Kleint2012-10-021-1/+4
| | | | | | | | | Position the QIODevice correctly for DIB (==BMP without file header). Task-number: QTBUG-26690 Change-Id: I7922b4e830a92dcc19f1b52e305ca9ff3fd5d9f5 Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>