summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOBATA Akio <obache@wizdas.com>2020-07-18 17:10:20 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2020-07-19 01:16:14 +0900
commit083e02fe7f7a2f8dbd84161fe8126608cbfc8c60 (patch)
treed81bb1f59f178cfe59a03f3864a5ab59310f0027
parent2af1a05e8280aa5103c6c3c8c6ab88208dbc7f61 (diff)
downloadtqt3-083e02fe7f7a2f8dbd84161fe8126608cbfc8c60.tar.gz
tqt3-083e02fe7f7a2f8dbd84161fe8126608cbfc8c60.zip
Remove unwanted code for writing png
`info_ptr->channels` will be set in the next called `png_set_IHDR()`, so it is no effect. Signed-off-by: OBATA Akio <obache@wizdas.com> (cherry picked from commit b6a4a5ec2001abed68c01d5c6baabbc2319214dc)
-rw-r--r--src/kernel/qpngio.cpp13
1 files changed, 0 insertions, 13 deletions
diff --git a/src/kernel/qpngio.cpp b/src/kernel/qpngio.cpp
index 44d284bc..ce2f625f 100644
--- a/src/kernel/qpngio.cpp
+++ b/src/kernel/qpngio.cpp
@@ -568,19 +568,6 @@ bool TQPNGImageWriter::writeImage(const TQImage& image, int quality_in, int off_
png_set_write_fn(png_ptr, (void*)this, qpiw_write_fn, qpiw_flush_fn);
-#if PNG_LIBPNG_VER>=10500
-#warning XXXtnn not too sure about this
-/*
-according to png.h, channels is only used on read, not writes, so we
-should be able to comment this out.
-*/
-#else /* LIBPNG 1.5 */
- info_ptr->channels =
- (image.depth() == 32)
- ? (image.hasAlphaBuffer() ? 4 : 3)
- : 1;
-#endif /* LIBPNG 1.5 */
-
png_set_IHDR(png_ptr, info_ptr, image.width(), image.height(),
image.depth() == 1 ? 1 : 8 /* per channel */,
image.depth() == 32