This patch is originally taken from:

http://leptonica.googlecode.com/issues/attachment?aid=560001000&name=zlib-include.patch&token=m2sugSYxB4xwAuNgrKXyHTxBYNg%3A1337345966091

To fix the following issue with leptonica:

http://code.google.com/p/leptonica/issues/detail?id=56

diff -Nurd -x'*~' leptonica-1.68.orig/src/pngio.c leptonica-1.68/src/pngio.c
--- leptonica-1.68.orig/src/pngio.c	2011-02-01 00:41:12.000000000 -0500
+++ leptonica-1.68/src/pngio.c	2011-07-09 09:17:17.000000000 -0400
@@ -108,6 +108,10 @@
 
 #include "png.h"
 
+#ifdef HAVE_LIBZ
+#include "zlib.h"
+#endif
+
 /* ----------------Set defaults for read/write options ----------------- */
     /* strip 16 bpp --> 8 bpp on reading png; default is for stripping */
 static l_int32   var_PNG_STRIP_16_TO_8 = 1;
