[tkimg/f21] fix issues with libpng16

Tom Callaway spot at fedoraproject.org
Tue Mar 10 14:46:57 UTC 2015


commit d9d6aee5cd0e762900a8ca627290647fac71626e
Author: Tom Callaway <spot at fedoraproject.org>
Date:   Tue Mar 10 10:46:56 2015 -0400

    fix issues with libpng16

 tkimg-libpng16.patch | 90 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 tkimg.spec           |  5 ++-
 2 files changed, 94 insertions(+), 1 deletion(-)
---
diff --git a/tkimg-libpng16.patch b/tkimg-libpng16.patch
index d4d5913..f9c9381 100644
--- a/tkimg-libpng16.patch
+++ b/tkimg-libpng16.patch
@@ -1569,3 +1569,93 @@ diff -up tkimg1.4/libpng/pngtclDecls.h.png16 tkimg1.4/libpng/pngtclDecls.h
  
  #endif /* defined(USE_PNGTCL_STUBS) */
  
+diff -up tkimg1.4/libpng/pngtclStubInit.c.png17 tkimg1.4/libpng/pngtclStubInit.c
+--- tkimg1.4/libpng/pngtclStubInit.c.png17	2015-03-10 10:33:45.789718735 -0400
++++ tkimg1.4/libpng/pngtclStubInit.c	2015-03-10 10:33:49.186692665 -0400
+@@ -945,6 +945,49 @@ const PngtclStubs pngtclStubs = {
+ #else  /* !PNG_cHRM_SUPPORTED */
+     png_set_cHRM_XYZ_fixed, /* 233 */
+ #endif /* !PNG_cHRM_SUPPORTED */
++#if !defined(PNG_STDIO_SUPPORTED)
++    0, /* 234 */
++    0, /* 235 */
++#else /* !PNG_STDIO_SUPPORTED */
++    png_image_begin_read_from_file, /* 234 */
++    png_image_begin_read_from_stdio, /* 235 */
++#endif /* !PNG_STDIO_SUPPORTED */
++#if !defined(PNG_SIMPLIFIED_READ_SUPPORTED)
++    0, /* 236 */
++    0, /* 237 */
++    0, /* 238 */
++#else /* !PNG_SIMPLIFIED_READ_SUPPORTED */
++    png_image_begin_read_from_memory, /* 236 */
++    png_image_finish_read, /* 237 */
++    png_image_free, /* 238 */
++#endif /* !PNG_SIMPLIFIED_READ_SUPPORTED */
++#if !defined(PNG_STDIO_SUPPORTED)
++    0, /* 239 */
++    0, /* 240 */
++#else /* !PNG_STDIO_SUPPORTED */
++    png_image_write_to_file, /* 239 */
++    png_image_write_to_stdio, /* 240 */
++#endif /* !PNG_STDIO_SUPPORTED */
++#if !defined(PNG_TIME_RFC1123_SUPPORTED)
++    0, /* 241 */
++#else /* !PNG_TIME_RFC1123_SUPPORTED */
++    png_convert_to_rfc1123_buffer, /* 241 */
++#endif /* !PNG_TIME_RFC1123_SUPPORTED */
++#if !defined(PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED)
++    0, /* 242 */
++#else /* !PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED */
++    png_set_check_for_invalid_index, /* 242 */
++#endif /* !PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED */
++#if !defined(PNG_GET_PALETTE_MAX_SUPPORTED)
++    0, /* 243 */
++#else /* !PNG_GET_PALETTE_MAX_SUPPORTED */
++    png_get_palette_max, /* 243 */
++#endif /* !PNG_GET_PALETTE_MAX_SUPPORTED */
++#if !defined(PNG_SET_OPTION_SUPPORTED)
++    0, /* 244 */
++#else /* !PNG_SET_OPTION_SUPPORTED */
++    png_set_option, /* 244 */
++#endif /* !PNG_SET_OPTION_SUPPORTED */
+ };
+ 
+ /* !END!: Do not edit above this line. */
+diff -up tkimg1.4/png/png.c.png16 tkimg1.4/png/png.c
+--- tkimg1.4/png/png.c.png16	2015-03-10 10:41:53.372976000 -0400
++++ tkimg1.4/png/png.c	2015-03-10 10:42:18.746781230 -0400
+@@ -332,6 +332,16 @@ CommonReadPNG(png_ptr, interp, format, i
+ 	png_set_expand(png_ptr);
+     }
+ 
++    if (png_get_sRGB && png_get_sRGB(png_ptr, info_ptr, &intent)) {
++        png_set_sRGB(png_ptr, info_ptr, intent);
++    } else if (png_get_gAMA) {
++        double gamma;
++        if (!png_get_gAMA(png_ptr, info_ptr, &gamma)) {
++            gamma = 0.45455;
++        }
++       	png_set_gamma(png_ptr, 1.0, gamma);
++    }
++
+     png_read_update_info(png_ptr,info_ptr);
+     block.pixelSize = png_get_channels(png_ptr, info_ptr);
+     block.pitch = png_get_rowbytes(png_ptr, info_ptr);
+@@ -353,16 +363,6 @@ CommonReadPNG(png_ptr, interp, format, i
+ 	block.offset[3] = 0;
+     }
+ 
+-    if (png_get_sRGB && png_get_sRGB(png_ptr, info_ptr, &intent)) {
+-	png_set_sRGB(png_ptr, info_ptr, intent);
+-    } else if (png_get_gAMA) {
+-	double gamma;
+-	if (!png_get_gAMA(png_ptr, info_ptr, &gamma)) {
+-	    gamma = 0.45455;
+-	}
+-	png_set_gamma(png_ptr, 1.0, gamma);
+-    }
+-
+     png_data= (char **) ckalloc(sizeof(char *) * info_height +
+ 	    info_height * block.pitch);
+ 
diff --git a/tkimg.spec b/tkimg.spec
index cdc1045..cd02ffe 100644
--- a/tkimg.spec
+++ b/tkimg.spec
@@ -3,7 +3,7 @@
 
 Name:		tkimg
 Version:	1.4
-Release:	19%{?dist}
+Release:	20%{?dist}
 Summary:	Image support library for Tk
 Group:		Development/Libraries
 License:	BSD
@@ -109,6 +109,9 @@ done
 %{tcl_sitearch}/Img1.4/*.a
 
 %changelog
+* Tue Mar 10 2015 Tom Callaway <spot at fedoraproject.org> - 1.4-20
+- add missing libpng16 bits
+
 * Mon Nov  3 2014 Tom Callaway <spot at fedoraproject.org> - 1.4-19
 - add Requires: tk
 - remove deprecated libpng api bit


More information about the scm-commits mailing list