[imview] 03/04: Fix for libpng1.6 (Closes: #820439)
Anton Gladky
gladk at moszumanska.debian.org
Sat Apr 9 05:27:13 UTC 2016
This is an automated email from the git hooks/post-receive script.
gladk pushed a commit to branch master
in repository imview.
commit 0f258fd44e91d4671b59f154fc48417a6a9fa9b7
Author: Tobias Frost <tobi at debian.org>
Date: Fri Apr 8 22:56:54 2016 +0200
Fix for libpng1.6 (Closes: #820439)
---
debian/patches/08_fix_libpng16.patch | 80 ++++++++++++++++++++++++++++++++++++
debian/patches/series | 1 +
2 files changed, 81 insertions(+)
diff --git a/debian/patches/08_fix_libpng16.patch b/debian/patches/08_fix_libpng16.patch
new file mode 100644
index 0000000..cc98fda
--- /dev/null
+++ b/debian/patches/08_fix_libpng16.patch
@@ -0,0 +1,80 @@
+Description: Patch for libpng1.6
+ libpng1.6 removed direct access of its member functions.
+Author: Tobias Frost <tobi at debian.org>
+Bug-Debian: https://bugs.debian.org/820439
+Forwarded: no
+Last-Update: 2016-04-08
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/io/readpng.cxx
++++ b/io/readpng.cxx
+@@ -96,7 +96,7 @@
+ pp = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
+ info = png_create_info_struct(pp);
+
+- if (setjmp(pp->jmpbuf))
++ if (setjmp(png_jmpbuf(pp)))
+ {
+ errprintf("PNG file \"%s\" contains errors!\n", pngfilename);
+ return 103;
+@@ -108,28 +108,40 @@
+ // Get the image dimensions and convert to grayscale or RGB...
+ png_read_info(pp, info);
+
+- if (info->color_type == PNG_COLOR_TYPE_PALETTE)
++ png_uint_32 width;
++ png_uint_32 height;
++ int bit_depth;
++ int color_type;
++ int interlace_type;
++ int compression_type;
++ int filter_method;
++
++ png_get_IHDR(pp, info, &width, &height,
++ &bit_depth, &color_type, &interlace_type,
++ &compression_type, &filter_method);
++
++ if (color_type == PNG_COLOR_TYPE_PALETTE)
+ png_set_expand(pp);
+
+- if (info->color_type & PNG_COLOR_MASK_COLOR)
++ if (color_type & PNG_COLOR_MASK_COLOR)
+ channels = 3;
+ else
+ channels = 1;
+
+- if ((info->color_type & PNG_COLOR_MASK_ALPHA) || info->num_trans)
++ if ((color_type & PNG_COLOR_MASK_ALPHA) || info->num_trans)
+ channels ++;
+
+- w = (int)(info->width);
+- h = (int)(info->height);
++ w = (int)(width);
++ h = (int)(height);
+ d = channels;
+
+- if (info->bit_depth < 8)
++ if (bit_depth < 8)
+ {
+ png_set_packing(pp);
+ png_set_expand(pp);
+ }
+ // we ought to read the 16-bit data correctly, since we can !
+- else if (info->bit_depth == 16)
++ else if (bit_depth == 16)
+ png_set_strip_16(pp);
+
+ # if defined(HAVE_PNG_GET_VALID) && defined(HAVE_PNG_SET_TRNS_TO_ALPHA)
+--- a/io/readpng.cxx
++++ b/io/readpng.cxx
+@@ -128,7 +128,9 @@
+ else
+ channels = 1;
+
+- if ((color_type & PNG_COLOR_MASK_ALPHA) || info->num_trans)
++ int num_trans;
++ png_get_tRNS(pp, info, NULL, &num_trans, NULL);
++ if ((color_type & PNG_COLOR_MASK_ALPHA) || num_trans)
+ channels ++;
+
+ w = (int)(width);
diff --git a/debian/patches/series b/debian/patches/series
index c0366a0..878c339 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -5,3 +5,4 @@
05_fix_dangerous_use_of_strncpy.patch
06_fix_format_not_a_string.patch
07_fix_kfreebsd_FTBFS.patch
+08_fix_libpng16.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/imview.git
More information about the debian-science-commits
mailing list