<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">Compatibility with libpng 1.5 and later.
--- libgcode/gcode_image.c.orig	2010-07-23 10:15:13.000000000 -0500
+++ libgcode/gcode_image.c	2019-05-29 06:27:52.000000000 -0500
@@ -260,8 +260,8 @@
 
   png_read_info (png_ptr, info_ptr);
 
-  image-&gt;res[0] = info_ptr-&gt;width;
-  image-&gt;res[1] = info_ptr-&gt;height;
+  image-&gt;res[0] = png_get_image_width (png_ptr, info_ptr);
+  image-&gt;res[1] = png_get_image_height (png_ptr, info_ptr);
 
 /*  printf ("image size: %dx%d\n", image-&gt;res[0], image-&gt;res[1]); */
 
@@ -274,16 +274,16 @@
 
   row_pointers = (png_bytep *) malloc (sizeof (png_bytep) * image-&gt;res[1]);
   for (y = 0; y &lt; image-&gt;res[1]; y++)
-    row_pointers[y] = (png_byte*) malloc (info_ptr-&gt;rowbytes);
+    row_pointers[y] = (png_byte*) malloc (png_get_rowbytes (png_ptr, info_ptr));
 
   png_read_image (png_ptr, row_pointers);
 
   image-&gt;dmap = (gfloat_t *) malloc (sizeof (gfloat_t) * image-&gt;res[0] * image-&gt;res[1]);
 
   incr = 1;
-  if (info_ptr-&gt;color_type &amp; PNG_COLOR_MASK_COLOR)
+  if (png_get_color_type (png_ptr, info_ptr) &amp; PNG_COLOR_MASK_COLOR)
     incr = 3;
-  if (info_ptr-&gt;color_type &amp; PNG_COLOR_MASK_ALPHA)
+  if (png_get_color_type (png_ptr, info_ptr) &amp; PNG_COLOR_MASK_ALPHA)
     incr = 4;
 
   for (y = 0; y &lt; image-&gt;res[1]; y++)
</pre></body></html>