diff options
author | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2015-05-20 13:35:07 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2015-05-21 08:49:47 +0000 |
commit | d4a296b538da93f5c915fc7e886c6995f1b41169 (patch) | |
tree | 14fcd9868838ac179fe15ecfbabe2a3a42fd7279 /src/gui/image | |
parent | 938f9fc0f8ff1575413ca3d6d66860b5fa315768 (diff) |
Do not modify decoder when determining image-format
We should not configure the decoder when just determining the image-
format. Doing so can cause all versions of libpng to print a warning,
and some versions to fail to decode.
The code appears to be a leftover from when the image-format logic was
copied out of the introduction of the decoding method, where the proper
settings are still applied.
Task-number: QTBUG-46233
Change-Id: I6619728804f040ae6c9d637c7298a8586e22499e
Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
Reviewed-by: aavit <eirik.aavitsland@theqtcompany.com>
Diffstat (limited to 'src/gui/image')
-rw-r--r-- | src/gui/image/qpnghandler.cpp | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/src/gui/image/qpnghandler.cpp b/src/gui/image/qpnghandler.cpp index 17a0dd3eb9..304ab0cf3e 100644 --- a/src/gui/image/qpnghandler.cpp +++ b/src/gui/image/qpnghandler.cpp @@ -674,16 +674,9 @@ QImage::Format QPngHandlerPrivate::readImageFormat() && num_palette <= 256) { // 1-bit and 8-bit color - if (bit_depth != 1) - png_set_packing(png_ptr); - png_read_update_info(png_ptr, info_ptr); - png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, 0, 0, 0); format = bit_depth == 1 ? QImage::Format_Mono : QImage::Format_Indexed8; } else { // 32-bit - if (bit_depth == 16) - png_set_strip_16(png_ptr); - format = QImage::Format_ARGB32; // Only add filler if no alpha, or we can get 5 channel data. if (!(color_type & PNG_COLOR_MASK_ALPHA) |