summaryrefslogtreecommitdiffstats
path: root/tools/qvfb/qanimationwriter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/qvfb/qanimationwriter.cpp')
-rw-r--r--tools/qvfb/qanimationwriter.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/tools/qvfb/qanimationwriter.cpp b/tools/qvfb/qanimationwriter.cpp
index 5ff02a2..c91a916 100644
--- a/tools/qvfb/qanimationwriter.cpp
+++ b/tools/qvfb/qanimationwriter.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -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