pngmeta ======= This small filter program extracts metadata from PNG images and displays them as either HTML, SOIF, RDF/XML or simple fields and values. This software is distributed under the same copyright as the PNG Reference Library (libpng), upon which some of this code is based -- see pngmeta.c for details. Requirements ------------ * An ANSI C compiler -- preferrably gcc * libpng (tested with 1.0.8) * zlib (tested with 1.1.4) The latter two packages are available from http://www.libpng.org/pub/png/ andr many other places, see the PNG Home Page for details. Installation ------------ Use the GNU configuration program: ./configure make This package needs the libpng and zlib libraries and header files and you have several ways to specify this if the above fails. If you have installed these packages in the default places (libs in usual lib path, includes under /usr/include), then they will be automatically found. If you have compiled the packages but they remain in the source dirs, use one of these options to configure: --with-png=DIR DIR is root for libpng distribution --with-zlib=DIR DIR is root for libz distribution Note, this automatically happens the distributions are found in nearby directories with these names: zlib-X.* zlib (subdirectories) or ../zlib libpng-X.* libpng (subdirectories) or ../libpng If the libraries and headers are installed in places that cannot be found by configure, you can specify the individual libraries and include paths with these options: --with-zlib-lib=LIB LIB is path to libz.a --with-png-lib=LIB LIB is path to libpng.a --with-png-includes=DIR DIR is path where PNG header files can be found, defaults to /usr/include --with-zlib-includes=DIR DIR is path where ZLIB header files can be found, defaults to /usr/include OR If all of that fails, use the Makefile.old, Edit the ZLIB and LIBPNG variables in the makefile to point to the zlib and libpng installation directories. Pick a C compiler (by default set for gcc) and ranlib and then do a 'make -f Makefile.old'. Testing ------- Three test PNG images are provided: ct1n0g04.png ctzn0g04.png which contain uncompressed and compressed text chunks respectively. These are part of the PNG image test suite written by Willem A.J. van Schaik 8859.png All the printable ISO 8859-1 Latin 1 characters from hex codes 20 to 7E and A0 to FF provided by Chris Lilley and these are all checked when 'make check' is run Usage Examples -------------- mint% pngmeta goldhill.png pngmeta: PNG meta data for goldhill.png: Title: GOLDHILL: Photo of hill in small European town. Copyright: Unknown Modification Time: 23 Apr 1995 01:15:08 +0000 mint% pngmeta --soif ct1n0g04.png @FILE { ct1n0g04.png image-format{3}: PNG image-colors{1}: 4 image-width{2}: 32 image-height{2}: 32 image-type{25}: Grayscale, non-interlaced Title{8}: PngSuite Author{49}: Willem A.J. van Schaik (gwillem@ntuvax.ntu.ac.sg) Copyright{43}: Copyright Willem van Schaik, Singapore 1995 Description{239}: A compilation of a set of images created to test the various color-types of the PNG format. Included are black&white, color, paletted, with alpha channel, with transparency formats. All bit-depths allowed according to the spec are present. Software{48}: Created on a NeXTstation color using "pnmtopng". Disclaimer{9}: Freeware. } See the manual page for more information on the options and usage. Implementation -------------- The program contains a new function png_skip_till_end() that takes up the reading of the PNG data stream after the first IDAT has been detected. It then copies through, checking the CRCs of them but not decompressing or processing them. Finally, any remaining chunks are processed in the standard fashion. Copyright --------- This code was modified from the code for png_read_end() from the libpng library. See pngmeta.c for the full copyright headers - they have to remain in that file to comply with them. I wrote the GNU automake/autoconf configuration files with the libpng and zlib searching stuff and give permission for other people to use it to autoconfigure png and zlib in their programs, as long as you acknowledge me via my home page URI below. Getting Latest Versions ---------------------- See the: PNG and MNG tools at SourceForge http://sourceforge.net/projects/pmt/ CVS http://cvs.ilrt.org/cvsweb/png/pngmeta/ Thanks ------ ... to Rick Rodgers for the manual page. ... to Dan Brickley for RDF/XML output idea. Dave Beckett Dave.Beckett@bristol.ac.uk http://purl.org/net/dajobe/