Description: Fix FTBFS with libpng 1.5
Author: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Forwarded: Yes

Index: jkmeter/source/png2img.cc
===================================================================
--- jkmeter.orig/source/png2img.cc	2011-08-03 02:49:35.525296179 +0200
+++ jkmeter/source/png2img.cc	2011-08-03 02:53:39.657304866 +0200
@@ -76,16 +76,15 @@
                   PNG_TRANSFORM_STRIP_16 | PNG_TRANSFORM_PACKING | PNG_TRANSFORM_EXPAND,
                   0);
 
-// This requires libpng14 or later. If you still have an
-// older version, use the three commented lines instead.
-
-    dx = png_get_image_width (png_ptr, png_info);
-    dy = png_get_image_height (png_ptr, png_info);
-    dp = (png_get_color_type (png_ptr, png_info) & PNG_COLOR_MASK_ALPHA) ? 4 : 3;
-
-//    dx = png_info->width;
-//    dy = png_info->height;
-//    dp = (png_info->color_type & PNG_COLOR_MASK_ALPHA) ? 4 : 3;
+#if PNG_LIBPNG_VER_MAJOR >= 1 && PNG_LIBPNG_VER_MINOR >= 4
+	dx = png_get_image_width(png_ptr, png_info);
+	dy = png_get_image_height(png_ptr, png_info);
+	dp = (png_get_color_type(png_ptr, png_info) & PNG_COLOR_MASK_ALPHA) ? 4 : 3;
+#else
+     dx = png_info->width;
+     dy = png_info->height;
+     dp = (png_info->color_type & PNG_COLOR_MASK_ALPHA) ? 4 : 3;
+#endif
 
     data = (const unsigned char **)(png_get_rows (png_ptr, png_info));
 
