Copy from GNOME:Apps/gimp based on submit request 37078 from user vuntz OBS-URL: https://build.opensuse.org/request/show/37078 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/gimp?expand=0&rev=40
40 lines
1.3 KiB
Diff
40 lines
1.3 KiB
Diff
From b22eb0a8271a99257fe214cbf0adda29cf9a39dd Mon Sep 17 00:00:00 2001
|
|
From: Michael Natterer <mitch@gimp.org>
|
|
Date: Sun, 31 Jan 2010 11:28:02 +0000
|
|
Subject: 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.
|
|
---
|
|
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);
|
|
--
|
|
cgit v0.8.3.1
|