summaryrefslogtreecommitdiffstats
path: root/src/gui/image/qpnghandler.cpp
Commit message (Collapse)AuthorAgeFilesLines
* PNG: properly handle 1bpp greyscale images with alphaGiuseppe D'Angelo2013-09-181-0/+9
| | | | | | | | | | | | | PNG allows 1bpp greyscale images (PNG_COLOR_TYPE_GRAY) to have an alpha key; so even in this case we need to inquiry if the image has a transparency, and if so modify the color table of the monochrome image accordingly. Task-number: QTBUG-33503 Change-Id: Iab07c8f95ac8865269c48816e222645cdcb6bbc1 Reviewed-by: Nicolas Arnaud-Cormos <nicolas@kdab.com> Reviewed-by: aavit <eirik.aavitsland@digia.com>
* Add missing initialization before requesting png data for scaled readSamuel Gaist2013-09-181-7/+8
| | | | | | | | | | Initialize all values read to sensible default in case reading them fails in read_image_scaled. It has already been done for a normal image read Task-number: QTBUG-32674 Change-Id: I19dccad7ef342f1b1bba6b513c04d3661d128a54 Reviewed-by: aavit <eirik.aavitsland@digia.com>
* Initialize variables to fix valgrind warning in pnghandler.Friedemann Kleint2013-08-301-8/+8
| | | | | | | | | Conditional jump or move depends on uninitialised value(s) ==7986== at 0x5B838E8: QPngHandlerPrivate::readPngImage(QImage*) (qpnghandler.cpp:617) Change-Id: Ie739ca1665ce600426e2816a6229145d814125cb Reviewed-by: aavit <eirik.aavitsland@digia.com>
* Add offset reading support in pnghandlerSamuel Gaist2013-08-071-1/+17
| | | | | | | | | This patch adds the offset reading that matches the offset writing in writeImage Task-number: QTBUG-32674 Change-Id: I264ba41163e59638d7219e0a8913f9d455830883 Reviewed-by: aavit <eirik.aavitsland@digia.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@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 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>
* 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>
* Doc: Fix misc. documentation errorsaavit2012-08-301-9/+1
| | | | | Change-Id: I9481ed452922ed5ecd159a8f60d7fbcb3683cec1 Reviewed-by: Kim M. Kalland <kim.kalland@nokia.com>
* Fix -Wclobbered warningsMarc Mutz2012-08-181-2/+2
| | | | | | | | | | | | | | | | | GCC warns: warning: argument 'x' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered] Apparently, the real fix would be annotating the functions correctly with noreturn and returns_twice attributes, but there's also workarounds for these, at least in the png case, so adding volatile was the easier way out here. Needed a cast to lose the volatile again, passing the argument to qMin(). Change-Id: Id820cf9b65752359f3b8f268172ba71bc9a76784 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Get rid of some deprecation warningsLars Knoll2012-04-281-3/+3
| | | | | Change-Id: I05e6f9479789652cc1536cb5bced2bc8fa664c84 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Implement inline downscaling in png reader, to save memoryaavit2012-04-271-60/+153
| | | | | | | | | 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>
* get rid of QT_NO_IMAGE_TEXT switcherKonstantin Ritt2012-04-251-13/+2
| | | | | Change-Id: Ie72f907ffb959f629af6a414959348a992c4c941 Reviewed-by: aavit <qt_aavit@ovi.com>
* Deprecate qMemCopy/qMemSet in favour of their stdlib equivilents.Robin Burchell2012-04-111-2/+2
| | | | | | | | | | | | | | | | | | Just like qMalloc/qRealloc/qFree, there is absolutely no reason to wrap these functions just to avoid an include, except to pay for it with worse runtime performance. On OS X, on byte sizes from 50 up to 1000, calling memset directly is 28-15% faster(!) than adding an additional call to qMemSet. The advantage on sizes above that is unmeasurable. For qMemCopy, the benefits are a little more modest: 16-7%. Change-Id: I98aa92bb765aea0448e3f20af42a039b369af0b3 Reviewed-by: Giuseppe D'Angelo <dangelog@gmail.com> Reviewed-by: John Brooks <john.brooks@dereferenced.net> Reviewed-by: Thiago Macieira <thiago.macieira@intel.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>
* 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 build with Clang for libpng versions 1.4.0 to 1.5.2Tor Arne Vestbø2011-08-311-0/+23
| | | | | | | | | | | | | | | | | | | | | Versions 1.4.0 to 1.5.2 of libpng declare png_longjmp_ptr to have a noreturn attribute if PNG_PEDANTIC_WARNINGS_SUPPORTED is enabled, but most declarations of longjmp in the wild do not add this attribute. This causes problems when the png_jmpbuf macro expands to calling png_set_longjmp_fn with a mismatched longjmp, as compilers such as Clang will treat this as an error. To work around this we override the png_jmpbuf macro to cast longjmp to a png_longjmp_ptr. See also http://llvm.org/bugs/show_bug.cgi?id=10338 Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com> Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com> Change-Id: I197cfa12af76410310e409bc0fce7d4332ee66a6 Reviewed-on: http://codereview.qt.nokia.com/3929 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Update licenseheader text in source files for qtbase Qt moduleJyri Tahtela2011-05-241-17/+17
| | | | | | | Updated version of LGPL and FDL licenseheaders. Apply release phase licenseheaders for all source files. Reviewed-by: Trust Me
* Initial import from the monolithic Qt.Qt by Nokia2011-04-271-0/+991
This is the beginning of revision history for this module. If you want to look at revision history older than this, please refer to the Qt Git wiki for how to use Git history grafting. At the time of writing, this wiki is located here: http://qt.gitorious.org/qt/pages/GitIntroductionWithQt If you have already performed the grafting and you don't see any history beyond this commit, try running "git log" with the "--follow" argument. Branched from the monolithic repo, Qt master branch, at commit 896db169ea224deb96c59ce8af800d019de63f12