From 4d570be67303f5b80ed0377ac7307afd8bc18643 Mon Sep 17 00:00:00 2001
From: Bernhard Rosenkraenzer
Date: Mon, 17 Jan 2011 16:32:39 +0100
Subject: Make qvfb compile (and work) with libpng 1.5
In libpng >= 1.5.0, the png_info struct is no longer exported
Merge-request: 1023
Reviewed-by: Oswald Buddenhagen
---
tools/qvfb/qanimationwriter.cpp | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/tools/qvfb/qanimationwriter.cpp b/tools/qvfb/qanimationwriter.cpp
index 74a7b5f..c91a916 100644
--- a/tools/qvfb/qanimationwriter.cpp
+++ b/tools/qvfb/qanimationwriter.cpp
@@ -112,9 +112,11 @@ public:
void writePNG(const QImage& image)
{
-#ifndef QT_LINUXBASE
+#if !defined(QT_LINUXBASE) && \
+ (PNG_LIBPNG_VER_MAJOR < 1 || (PNG_LIBPNG_VER_MAJOR == 1 && PNG_LIBPNG_VER_MINOR <= 4))
// LSB disallows accessing the info_ptr directly. LSB's png_set_IHDR sets
- // the channels anyways, so just comment it out for LSB usage
+ // the channels anyways, so just comment it out for LSB usage.
+ // In libpng >= 1.5, the png_info struct is no longer exported.
info_ptr->channels = 4;
#endif
png_set_sig_bytes(png_ptr, 8); // Pretend we already wrote the sig
--
cgit v0.12