summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancois Andriot <francois.andriot@free.fr>2013-08-15 21:15:52 +0200
committerSlávek Banko <slavek.banko@axis.cz>2015-12-15 19:53:48 +0100
commit19b34d5dcfabb80e51b4b746ac57d2c6a8cfd94e (patch)
treeffba9cff9864942565d941b43a82096677912cba
parent851cbaad8b7c153a92b76ff69f42975d3da8a213 (diff)
downloadqt3-19b34d5dcfabb80e51b4b746ac57d2c6a8cfd94e.tar.gz
qt3-19b34d5dcfabb80e51b4b746ac57d2c6a8cfd94e.zip
Fix FTBFS in qvfb with libpng >= 1.5
(cherry picked from commit af5bc055c269f2685f13f3614bcf9f17349efc95)
-rw-r--r--tools/qvfb/qanimationwriter.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/qvfb/qanimationwriter.cpp b/tools/qvfb/qanimationwriter.cpp
index 3555fc6..ad6a047 100644
--- a/tools/qvfb/qanimationwriter.cpp
+++ b/tools/qvfb/qanimationwriter.cpp
@@ -101,7 +101,15 @@ public:
void writePNG(const QImage& image)
{
+#if PNG_LIBPNG_VER_MAJOR>1 || ( PNG_LIBPNG_VER_MAJOR==1 && PNG_LIBPNG_VER_MINOR>=5 )
+#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 = 4;
+#endif
png_set_sig_bytes(png_ptr, 8); // Pretend we already wrote the sig
png_set_IHDR(png_ptr, info_ptr, image.width(), image.height(),
8, image.hasAlphaBuffer()