From 8c22c9be3e684db90cb97177e97d1ab40866e680 Mon Sep 17 00:00:00 2001 From: Sergey Borovkov Date: Thu, 25 Oct 2012 01:20:01 +0400 Subject: Remove unnecessary call to png_set_sBit when writing png files 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 --- src/gui/image/qpnghandler.cpp | 7 ------- 1 file changed, 7 deletions(-) (limited to 'src/gui') diff --git a/src/gui/image/qpnghandler.cpp b/src/gui/image/qpnghandler.cpp index 2307ceb7ae..8434282178 100644 --- a/src/gui/image/qpnghandler.cpp +++ b/src/gui/image/qpnghandler.cpp @@ -849,13 +849,6 @@ bool Q_INTERNAL_WIN_NO_THROW QPNGImageWriter::writeImage(const QImage& image, vo png_set_gAMA(png_ptr, info_ptr, 1.0/gamma); } - png_color_8 sig_bit; - sig_bit.red = 8; - sig_bit.green = 8; - sig_bit.blue = 8; - sig_bit.alpha = image.hasAlphaChannel() ? 8 : 0; - png_set_sBIT(png_ptr, info_ptr, &sig_bit); - if (image.format() == QImage::Format_MonoLSB) png_set_packswap(png_ptr); -- cgit v1.2.3