[gimp/gimp-2-6] Bug 607242 - GIMP 2.7.0 fails to build against libpng 1.4.0
- From: Michael Natterer <mitch src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gimp/gimp-2-6] Bug 607242 - GIMP 2.7.0 fails to build against libpng 1.4.0
- Date: Sun, 31 Jan 2010 11:31:34 +0000 (UTC)
commit b22eb0a8271a99257fe214cbf0adda29cf9a39dd
Author: Michael Natterer <mitch gimp org>
Date: Sun Jan 31 12:28:02 2010 +0100
Bug 607242 - GIMP 2.7.0 fails to build against libpng 1.4.0
Use png_set_expand_gray_1_2_4_to_8() instead of the deprecated
png_set_gray_1_2_4_to_8() if libpng is at least 1.2.27 (which is in
debian stable), so plug-ins built against old versions contine to work
when libpng 1.4 gets installed.
plug-ins/file-ico/ico-load.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/plug-ins/file-ico/ico-load.c b/plug-ins/file-ico/ico-load.c
index 79512ae..4d894be 100644
--- a/plug-ins/file-ico/ico-load.c
+++ b/plug-ins/file-ico/ico-load.c
@@ -287,14 +287,22 @@ ico_read_png (FILE *fp,
switch (color_type)
{
case PNG_COLOR_TYPE_GRAY:
+#if PNG_LIBPNG_VER < 10227
png_set_gray_1_2_4_to_8 (png_ptr);
+#else
+ png_set_expand_gray_1_2_4_to_8 (png_ptr);
+#endif
if ( bit_depth == 16 )
png_set_strip_16 (png_ptr);
png_set_gray_to_rgb (png_ptr);
png_set_add_alpha (png_ptr, 0xff, PNG_FILLER_AFTER);
break;
case PNG_COLOR_TYPE_GRAY_ALPHA:
+#if PNG_LIBPNG_VER < 10227
png_set_gray_1_2_4_to_8 (png_ptr);
+#else
+ png_set_expand_gray_1_2_4_to_8 (png_ptr);
+#endif
if ( bit_depth == 16 )
png_set_strip_16 (png_ptr);
png_set_gray_to_rgb (png_ptr);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]