Compare commits

...

2 Commits

Author SHA1 Message Date
Dave Beckett
21a5fdb597 Imported from pngmeta-1.11.tar 2012-10-12 10:01:10 -05:00
Dave Beckett
77b7eb6d63 Imported from pngmeta-1.10.tar 2012-10-12 10:00:45 -05:00
30 changed files with 4477 additions and 6 deletions

BIN
8859.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 802 B

156
ChangeLog Normal file
View File

@@ -0,0 +1,156 @@
2001-05-16 Dave Beckett <Dave.Beckett@bristol.ac.uk>
* Snapshotted pngmeta_1_11 for 1.11 release
* Makefile.am: Added man page to dist
* pngmeta.spec.in:
Tweak for gzipped mans
* Makefile.am: Added autogen.sh
* autogen.sh: For building from CVS
* .cvsignore: Ignore stuff
* README, pngmeta.spec.in:
Updated for sourceforge
* NEWS: Updated for 1.11
* README: Updated for latest versions
* configure.in:
Made local copies of libpng/zlib pick up includes too
* test4, test3, test2, test1:
Updated to work in 'make distcheck' mode
* pngmeta.1: Added --xrdf option
Updated zlib, png, my URIs
* configure.in: Added pngmeta.spec.in
* pngmeta.spec.in:
Now gets version, name from autoconf
* pngmeta.spec, pngmeta.spec.in:
Renamed pngmeta.spec to pngmeta.spec.in
* test1, test2, test3, test4:
Test scripts
* 8859.png: Test images
* pngmeta.c (png_start_image, png_end_image):
Added, separate from start/end output
Pass through any RDF/XML data stored in field XMLRDFDATA
Update to XHTML
* ct1n0g04.png, ctzn0g04.png:
Test images
* Makefile.old: Updated for 1.10 version
2000-08-15 Dave Beckett <Dave.Beckett@bristol.ac.uk>
* pngmeta.spec: Updated copyright
* pngmeta.c:
Uses png_get_text where available
Updated copyright
* Makefile.am: INCLUDES now CFLAGS
* configure.in:
Loads more changes to make it try to pick installed libpng/libz
wherever possible.
2000-02-01 Dave Beckett <Dave.Beckett@bristol.ac.uk>
* pngmeta.spec: Tweaked
2000-01-31 Dave Beckett <Dave.Beckett@bristol.ac.uk>
* Makefile.am:
Added pngmeta.spec to dist
* pngmeta.spec: New file.
* pngmeta.1, Makefile.old, configure.in:
Updated to 1.10 version
* pngmeta.c:
Updated for 1.10 release - added GNU --options, --help, --version
* NEWS: Updated for 1.10 release
* README: Updated for --options
* Makefile.am:
Added Makefile.old to dist
* Makefile.old: New file.
1999-04-16 Dave Beckett <Dave.Beckett@bristol.ac.uk>
* pngmeta.1: Added -uri URI docs.
* NEWS, configure.in:
1.9
* pngmeta.c:
Added -uri option to set uri for SOIF and RDF/XML output.
In RDF output, don't HTML-escape values that start with <RDF
* Makefile.am:
Added test4 files to dist.
* Makefile.am:
Added test4 for RDF/XML output
* pngmeta.1: Added -xrdf option
* README: 1.8 now with RDF/XML support
* NEWS: 1.8
* pngmeta.c:
Added RDF/XML thanks to Dan Brickley <daniel.brickley@bristol.ac.uk>
* configure.in: V 1.8
Look for ../libpng-[0-9] and ../zlib-[0-9]*
1998-09-11 Dave Beckett <Dave.Beckett@bristol.ac.uk>
* NEWS, README, configure.in, Makefile.am:
New file.
* pngmeta.c:
Take out version stuff; use VERSION passed in from autoconfiguration.
1998-03-10 Dave Beckett <Dave.Beckett@bristol.ac.uk>
* pngmeta.1: New file.
* pngmeta.c:
Upgraded for 1.0* versions of libraries
Output SOIF when progname is PngImage.sum
Output version and lib versions in usage message.
Use libpng time conversion routine.
1997-10-17 Dave Beckett <Dave.Beckett@bristol.ac.uk>
* pngmeta.c:
Updated for libpng 0.96 and zlib 1.0.4
1997-01-30 Dave Beckett <Dave.Beckett@bristol.ac.uk>
* pngmeta.c: PNG meta 1.3
* pngmeta.c: PNG meta 1.2
* pngmeta.c: PNG meta 1.0
* pngmeta.c: New file.

35
Makefile.am Normal file
View File

@@ -0,0 +1,35 @@
## -*- makefile -*-
##
## Process this file with automake to produce Makefile.in
##
## $Id: Makefile.am,v 1.8 2001/05/16 15:25:29 cmdjb Exp $
##
## Copyright 1998-2000, Dave Beckett, ILRT, University of Bristol
## http://purl.org/net/dajobe/
##
CFLAGS=@CFLAGS@
bin_PROGRAMS = pngmeta
man_MANS = pngmeta.1
AUTOMAKE_OPTIONS=foreign no-dependencies
EXTRA_DIST=test1 test2 test3 test4 \
test1.xpt test2.xpt test3.xpt test4.xpt \
8859.png ctzn0g04.png ct1n0g04.png \
pngmeta.1 Makefile.old pngmeta.spec \
autogen.sh
man_MANS=pngmeta.1
TESTS=test1 test2 test3 test4
test-results: pngmeta
./pngmeta -quiet ct1n0g04.png > test1.xpt
./pngmeta -soif -quiet ctzn0g04.png > test2.xpt
./pngmeta -html -quiet 8859.png > test3.xpt
./pngmeta -xrdf ct1n0g04.png > test4.xpt
MAINTAINERCLEANFILES=test1.xpt test2.xpt test3.xpt test4.xpt

409
Makefile.in Normal file
View File

@@ -0,0 +1,409 @@
# Makefile.in generated automatically by automake 1.4 from Makefile.am
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
SHELL = @SHELL@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
sbindir = @sbindir@
libexecdir = @libexecdir@
datadir = @datadir@
sysconfdir = @sysconfdir@
sharedstatedir = @sharedstatedir@
localstatedir = @localstatedir@
libdir = @libdir@
infodir = @infodir@
mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
DESTDIR =
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = .
ACLOCAL = @ACLOCAL@
AUTOCONF = @AUTOCONF@
AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
transform = @program_transform_name@
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
CC = @CC@
EXEEXT = @EXEEXT@
MAKEINFO = @MAKEINFO@
PACKAGE = @PACKAGE@
VERSION = @VERSION@
CFLAGS = @CFLAGS@
bin_PROGRAMS = pngmeta
man_MANS = pngmeta.1
AUTOMAKE_OPTIONS = foreign no-dependencies
EXTRA_DIST = test1 test2 test3 test4 test1.xpt test2.xpt test3.xpt test4.xpt 8859.png ctzn0g04.png ct1n0g04.png pngmeta.1 Makefile.old pngmeta.spec autogen.sh
TESTS = test1 test2 test3 test4
MAINTAINERCLEANFILES = test1.xpt test2.xpt test3.xpt test4.xpt
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_CLEAN_FILES = config.h pngmeta.spec
PROGRAMS = $(bin_PROGRAMS)
DEFS = @DEFS@ -I. -I$(srcdir)
CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
pngmeta_SOURCES = pngmeta.c
pngmeta_OBJECTS = pngmeta.o
pngmeta_LDADD = $(LDADD)
pngmeta_DEPENDENCIES =
pngmeta_LDFLAGS =
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
man1dir = $(mandir)/man1
MANS = $(man_MANS)
NROFF = nroff
DIST_COMMON = README ChangeLog Makefile.am Makefile.in NEWS aclocal.m4 \
config.h.in configure configure.in install-sh missing mkinstalldirs \
pngmeta.spec.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = gtar
GZIP_ENV = --best
SOURCES = pngmeta.c
OBJECTS = pngmeta.o
all: all-redirect
.SUFFIXES:
.SUFFIXES: .S .c .o .s
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
$(ACLOCAL_M4): configure.in
cd $(srcdir) && $(ACLOCAL)
config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
$(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
cd $(srcdir) && $(AUTOCONF)
config.h: $(top_builddir)/config.status config.h.in
cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
pngmeta.spec: $(top_builddir)/config.status pngmeta.spec.in
cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
mostlyclean-binPROGRAMS:
clean-binPROGRAMS:
-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
distclean-binPROGRAMS:
maintainer-clean-binPROGRAMS:
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
$(mkinstalldirs) $(DESTDIR)$(bindir)
@list='$(bin_PROGRAMS)'; for p in $$list; do \
if test -f $$p; then \
echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \
$(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
else :; fi; \
done
uninstall-binPROGRAMS:
@$(NORMAL_UNINSTALL)
list='$(bin_PROGRAMS)'; for p in $$list; do \
rm -f $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
done
.c.o:
$(COMPILE) -c $<
.s.o:
$(COMPILE) -c $<
.S.o:
$(COMPILE) -c $<
mostlyclean-compile:
-rm -f *.o core *.core
clean-compile:
distclean-compile:
-rm -f *.tab.c
maintainer-clean-compile:
pngmeta: $(pngmeta_OBJECTS) $(pngmeta_DEPENDENCIES)
@rm -f pngmeta
$(LINK) $(pngmeta_LDFLAGS) $(pngmeta_OBJECTS) $(pngmeta_LDADD) $(LIBS)
install-man1:
$(mkinstalldirs) $(DESTDIR)$(man1dir)
@list='$(man1_MANS)'; \
l2='$(man_MANS)'; for i in $$l2; do \
case "$$i" in \
*.1*) list="$$list $$i" ;; \
esac; \
done; \
for i in $$list; do \
if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
else file=$$i; fi; \
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \
$(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \
done
uninstall-man1:
@list='$(man1_MANS)'; \
l2='$(man_MANS)'; for i in $$l2; do \
case "$$i" in \
*.1*) list="$$list $$i" ;; \
esac; \
done; \
for i in $$list; do \
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \
rm -f $(DESTDIR)$(man1dir)/$$inst; \
done
install-man: $(MANS)
@$(NORMAL_INSTALL)
$(MAKE) $(AM_MAKEFLAGS) install-man1
uninstall-man:
@$(NORMAL_UNINSTALL)
$(MAKE) $(AM_MAKEFLAGS) uninstall-man1
tags: TAGS
ID: $(HEADERS) $(SOURCES) $(LISP)
list='$(SOURCES) $(HEADERS)'; \
unique=`for i in $$list; do echo $$i; done | \
awk ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
here=`pwd` && cd $(srcdir) \
&& mkid -f$$here/ID $$unique $(LISP)
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS)'; \
unique=`for i in $$list; do echo $$i; done | \
awk ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
|| (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
mostlyclean-tags:
clean-tags:
distclean-tags:
-rm -f TAGS ID
maintainer-clean-tags:
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
# This target untars the dist file and tries a VPATH configuration. Then
# it guarantees that the distribution is self-contained by making another
# tarfile.
distcheck: dist
-rm -rf $(distdir)
GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz
mkdir $(distdir)/=build
mkdir $(distdir)/=inst
dc_install_base=`cd $(distdir)/=inst && pwd`; \
cd $(distdir)/=build \
&& ../configure --srcdir=.. --prefix=$$dc_install_base \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \
&& $(MAKE) $(AM_MAKEFLAGS) install \
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
&& $(MAKE) $(AM_MAKEFLAGS) dist
-rm -rf $(distdir)
@banner="$(distdir).tar.gz is ready for distribution"; \
dashes=`echo "$$banner" | sed s/./=/g`; \
echo "$$dashes"; \
echo "$$banner"; \
echo "$$dashes"
dist: distdir
-chmod -R a+r $(distdir)
GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
-rm -rf $(distdir)
dist-all: distdir
-chmod -R a+r $(distdir)
GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
-rm -rf $(distdir)
distdir: $(DISTFILES)
-rm -rf $(distdir)
mkdir $(distdir)
-chmod 777 $(distdir)
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \
cp -pr $$d/$$file $(distdir)/$$file; \
else \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file || :; \
fi; \
done
check-TESTS: $(TESTS)
@failed=0; all=0; \
srcdir=$(srcdir); export srcdir; \
for tst in $(TESTS); do \
if test -f $$tst; then dir=.; \
else dir="$(srcdir)"; fi; \
if $(TESTS_ENVIRONMENT) $$dir/$$tst; then \
all=`expr $$all + 1`; \
echo "PASS: $$tst"; \
elif test $$? -ne 77; then \
all=`expr $$all + 1`; \
failed=`expr $$failed + 1`; \
echo "FAIL: $$tst"; \
fi; \
done; \
if test "$$failed" -eq 0; then \
banner="All $$all tests passed"; \
else \
banner="$$failed of $$all tests failed"; \
fi; \
dashes=`echo "$$banner" | sed s/./=/g`; \
echo "$$dashes"; \
echo "$$banner"; \
echo "$$dashes"; \
test "$$failed" -eq 0
info-am:
info: info-am
dvi-am:
dvi: dvi-am
check-am: all-am
$(MAKE) $(AM_MAKEFLAGS) check-TESTS
check: check-am
installcheck-am:
installcheck: installcheck-am
install-exec-am: install-binPROGRAMS
install-exec: install-exec-am
install-data-am: install-man
install-data: install-data-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
install: install-am
uninstall-am: uninstall-binPROGRAMS uninstall-man
uninstall: uninstall-am
all-am: Makefile $(PROGRAMS) $(MANS)
all-redirect: all-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
installdirs:
$(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(mandir)/man1
mostlyclean-generic:
clean-generic:
distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES)
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
maintainer-clean-generic:
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
mostlyclean-am: mostlyclean-binPROGRAMS mostlyclean-compile \
mostlyclean-tags mostlyclean-generic
mostlyclean: mostlyclean-am
clean-am: clean-binPROGRAMS clean-compile clean-tags clean-generic \
mostlyclean-am
clean: clean-am
distclean-am: distclean-binPROGRAMS distclean-compile distclean-tags \
distclean-generic clean-am
distclean: distclean-am
-rm -f config.status
maintainer-clean-am: maintainer-clean-binPROGRAMS \
maintainer-clean-compile maintainer-clean-tags \
maintainer-clean-generic distclean-am
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
maintainer-clean: maintainer-clean-am
-rm -f config.status
.PHONY: mostlyclean-binPROGRAMS distclean-binPROGRAMS clean-binPROGRAMS \
maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \
mostlyclean-compile distclean-compile clean-compile \
maintainer-clean-compile install-man1 uninstall-man1 install-man \
uninstall-man tags mostlyclean-tags distclean-tags clean-tags \
maintainer-clean-tags distdir check-TESTS info-am info dvi-am dvi check \
check-am installcheck-am installcheck install-exec-am install-exec \
install-data-am install-data install-am install uninstall-am uninstall \
all-redirect all-am all installdirs mostlyclean-generic \
distclean-generic clean-generic maintainer-clean-generic clean \
mostlyclean distclean maintainer-clean
test-results: pngmeta
./pngmeta -quiet ct1n0g04.png > test1.xpt
./pngmeta -soif -quiet ctzn0g04.png > test2.xpt
./pngmeta -html -quiet 8859.png > test3.xpt
./pngmeta -xrdf ct1n0g04.png > test4.xpt
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

68
Makefile.old Normal file
View File

@@ -0,0 +1,68 @@
#
# basic makefile for pngmeta
#
PACKAGE=pngmeta
VERSION=1.11
ZLIB=../zlib
LIBPNG=../libpng
# Compile with GNU cc
CC=gcc
EXTRA_CC_FLAGS=-W -Wall
# If you are not using gcc, set these options (must be an ANSI C compiler)
#CC=cc
#EXTRA_CC_FLAGS=
CFLAGS= -DPACKAGE=\"$(PACKAGE)\" -DVERSION=\"$(VERSION)\" $(EXTRA_CC_FLAGS) -I$(LIBPNG) -I$(ZLIB) -g
LDFLAGS=-L$(LIBPNG) -L$(ZLIB) -lpng -lz -lm
# Need ranlib?
#RANLIB=ranlib
RANLIB=echo
INSTALL=install
# hierarchy where make install puts pngmeta
prefix=/usr/local
# Nothing needs configuring below here
TEMPDIR=/tmp
OBJS = pngmeta.o
all: build
build: pngmeta
pngmeta: $(OBJS)
$(CC) -o pngmeta $(CCFLAGS) pngmeta.o $(LDFLAGS)
TESTS=test1 test2 test3 test4
check: pngmeta $(TESTS)
for test in $(TESTS); do \
$$test; \
done
test-results: pngmeta
./pngmeta -quiet ct1n0g04.png > test1.xpt
./pngmeta -soif -quiet ctzn0g04.png > test2.xpt
./pngmeta -html -quiet 8859.png > test3.xpt
./pngmeta -xrdf ct1n0g04.png > test4.xpt
install: pngmeta
-@mkdir $(prefix)/bin
$(INSTALL) -c pngmeta $(prefix)/bin
$(INSTALL) -c pngmeta.1 $(prefix)/man/man1/pngmeta.1
pngmeta.man: pngmeta.1
nroff -man $? > pngmeta.man
clean:
rm -f *.o pngmeta.man pngmeta *~

46
NEWS Normal file
View File

@@ -0,0 +1,46 @@
Changes
-------
Version
1.11 Checked with latest zlib (1.1.3), libpng (1.0.11).
Added --xrdf for RDF/XML output.
Added RPM building support.
Tidied for CVS.
HTML now XHTML.
1.10 Updated to use latest zlib (1.1.3), libpng (1.0.5o). Added
GNU style --options including --help page and --version
1.9 Added -uri URI option to set URI for SOIF and RDF/XML output
For RDF/XML output don't escape values starting with <RDF
1.8 Added RDF in XML output written by
Dan Brickley <daniel.brickley@bristol.ac.uk>
1.7 Bug in printing out version.
Updated to use GNU configure stuff.
1.6 libpng 1.0.0, zlib 1.1.1
Does SOIF by default when program is PngImage.sum
Version information output in usage and HTML.
Use libpng time formatting routine.
1.4-1.5 libpng 0.87, 0.88, 0.88b, 0.89c and finally 0.90
1.3 Tidied up HTML output. Tested with libpng 0.86
1.2 Added HTML output in <DL><DT>field</DT><DD><P>value</P></DD>...</DL>
form.
1.1 Now outputs image meta data: format, colors (bitdepth),
width, height and image type in the style of the GIF
summariser for Harvest V1.4 Only outputs this for SOIF format.
Prints modification time chunk (tIME) contents if present in
RFC 1123 format, as suggested by PNG spec.
1.0 For libpng 0.85 }
} Same functionality
0.9 For libpng 0.81 }

162
README Normal file
View File

@@ -0,0 +1,162 @@
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 <gwillem@ntuvax.ntu.ac.sg>
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 <chris@w3.org>
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 <rodgers@nlm.nih.gov> for the manual page.
... to Dan Brickley <daniel.brickley@bristol.ac.uk> for RDF/XML
output idea.
Dave Beckett
Dave.Beckett@bristol.ac.uk
http://purl.org/net/dajobe/

View File

@@ -1,6 +0,0 @@
/*
This is the master branch of the "pmt" tree.
Individual projects are in separate branches,
e.g. pngcrush is in the "pngcrush" branch.
*/

104
aclocal.m4 vendored Normal file
View File

@@ -0,0 +1,104 @@
dnl aclocal.m4 generated automatically by aclocal 1.4
dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl This program is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
dnl PARTICULAR PURPOSE.
# Do all the work for Automake. This macro actually does too much --
# some checks are only needed if your package does certain things.
# But this isn't really a big deal.
# serial 1
dnl Usage:
dnl AM_INIT_AUTOMAKE(package,version, [no-define])
AC_DEFUN(AM_INIT_AUTOMAKE,
[AC_REQUIRE([AC_PROG_INSTALL])
PACKAGE=[$1]
AC_SUBST(PACKAGE)
VERSION=[$2]
AC_SUBST(VERSION)
dnl test to see if srcdir already configured
if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
fi
ifelse([$3],,
AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
AC_REQUIRE([AM_SANITY_CHECK])
AC_REQUIRE([AC_ARG_PROGRAM])
dnl FIXME This is truly gross.
missing_dir=`cd $ac_aux_dir && pwd`
AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
AC_REQUIRE([AC_PROG_MAKE_SET])])
#
# Check to make sure that the build environment is sane.
#
AC_DEFUN(AM_SANITY_CHECK,
[AC_MSG_CHECKING([whether build environment is sane])
# Just in case
sleep 1
echo timestamp > conftestfile
# Do `set' in a subshell so we don't clobber the current shell's
# arguments. Must try -L first in case configure is actually a
# symlink; some systems play weird games with the mod time of symlinks
# (eg FreeBSD returns the mod time of the symlink's containing
# directory).
if (
set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
if test "[$]*" = "X"; then
# -L didn't work.
set X `ls -t $srcdir/configure conftestfile`
fi
if test "[$]*" != "X $srcdir/configure conftestfile" \
&& test "[$]*" != "X conftestfile $srcdir/configure"; then
# If neither matched, then we have a broken ls. This can happen
# if, for instance, CONFIG_SHELL is bash and it inherits a
# broken ls alias from the environment. This has actually
# happened. Such a system could not be considered "sane".
AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
alias in your environment])
fi
test "[$]2" = conftestfile
)
then
# Ok.
:
else
AC_MSG_ERROR([newly created file is older than distributed files!
Check your system clock])
fi
rm -f conftest*
AC_MSG_RESULT(yes)])
dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
dnl The program must properly implement --version.
AC_DEFUN(AM_MISSING_PROG,
[AC_MSG_CHECKING(for working $2)
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
if ($2 --version) < /dev/null > /dev/null 2>&1; then
$1=$2
AC_MSG_RESULT(found)
else
$1="$3/missing $2"
AC_MSG_RESULT(missing)
fi
AC_SUBST($1)])

120
autogen.sh Executable file
View File

@@ -0,0 +1,120 @@
#!/bin/sh
#
# autogen.sh - Generates the initial makefiles from a pristine CVS tree
#
# $Id: autogen.sh,v 1.1 2001/05/16 15:22:25 cmdjb Exp $
#
# USAGE: autogen.sh [configure options]
#
# If environment variable DRYRUN is set, no configuring will be done -
# (e.g. in bash) DRYRUN=1 ./autogen.sh
# will not do any configuring but will emit the programs that would be run.
#
# This script is based on similar scripts used in various tools
# commonly made available via CVS and used with GNU automake.
# Try 'locate autogen.sh' on your system and see what you get.
#
PACKAGE=pngmeta
DIE=
if test "X$DRYRUN" != X; then
DRYRUN=echo
fi
autoconf_vers=2.13
automake_vers=1.4
aclocal_vers=1.4
program=`basename $0`
if (autoconf --version) < /dev/null > /dev/null 2>&1 ; then
if (autoconf --version | awk 'NR==1 { if( $3 >= '$autoconf_vers') \
exit 1; exit 0; }');
then
echo "$program: ERROR: \`autoconf' is too old."
echo " (version $autoconf_vers or newer is required)"
DIE="yes"
fi
else
echo
echo "$program: ERROR: You must have \`autoconf' installed to compile $PACKAGE."
echo " (version $autoconf_vers or newer is required)"
DIE="yes"
fi
if (automake --version) < /dev/null > /dev/null 2>&1 ; then
if (automake --version | awk 'NR==1 { if( $4 >= '$automake_vers') \
exit 1; exit 0; }');
then
echo "$program: ERROR: \`automake' is too old."
echo " (version $automake_vers or newer is required)"
DIE="yes"
fi
if (aclocal --version) < /dev/null > /dev/null 2>&1; then
if (aclocal --version | awk 'NR==1 { if( $4 >= '$aclocal_vers' ) \
exit 1; exit 0; }' );
then
echo "$program: ERROR: \`aclocal' is too old."
echo " (version $aclocal_vers or newer is required)"
DIE="yes"
fi
else
echo
echo "$program: ERROR: Missing \`aclocal'"
echo " The version of automake installed doesn't appear recent enough."
DIE="yes"
fi
else
echo
echo "$program: ERROR: You must have \`automake' installed to compile $PACKAGE."
echo " (version $automake_vers or newer is required)"
DIE="yes"
fi
if test "X$DIE" != X; then
exit 1
fi
if test -z "$*"; then
echo "$program: WARNING: Running \`configure' with no arguments."
echo "If you wish to pass any to it, please specify them on the"
echo "\`$0' command line."
fi
am_opt=
for coin in `find $srcdir -name configure.in -print`
do
dir=`dirname $coin`
if test -f $dir/NO-AUTO-GEN; then
echo $program: Skipping $dir -- flagged as no auto-gen
else
echo $program: Processing directory $dir
( cd $dir
aclocalinclude="$ACLOCAL_FLAGS"
echo "$program: Running aclocal $aclocalinclude"
$DRYRUN aclocal $aclocalinclude
if grep "^AM_CONFIG_HEADER" configure.in >/dev/null; then
echo "$program: Running autoheader"
$DRYRUN autoheader
fi
echo "$program: Running automake $am_opt"
$DRYRUN automake --add-missing $am_opt
echo "$program: Running autoconf"
$DRYRUN autoconf
)
fi
done
conf_flags=
echo "$program: Running ./configure $conf_flags $@"
if test "X$DRYRUN" = X; then
$DRYRUN ./configure $conf_flags "$@" \
&& echo "$program: Now type \`make' to compile $PACKAGE" || exit 1
else
$DRYRUN ./configure $conf_flags "$@"
fi

14
config.h.in Normal file
View File

@@ -0,0 +1,14 @@
/* config.h.in. Generated automatically from configure.in by autoheader. */
/* Define if you have the png_create_read_struct function. */
#undef HAVE_PNG_CREATE_READ_STRUCT
/* Define if you have the png_get_text function. */
#undef HAVE_PNG_GET_TEXT
/* Name of package */
#undef PACKAGE
/* Version number of package */
#undef VERSION

1673
configure vendored Executable file

File diff suppressed because it is too large Load Diff

185
configure.in Normal file
View File

@@ -0,0 +1,185 @@
dnl -*- shell-script -*-
dnl
dnl Process this file with autoconf to produce a configure script.
dnl
dnl $Id: configure.in,v 1.7 2001/05/16 15:14:22 cmdjb Exp $
dnl
dnl Copyright 1998-2000 Dave Beckett, ILRT, University of Bristol
dnl http://purl.org/net/dajobe/
dnl
AC_REVISION($Revision: 1.7 $)
AC_INIT(pngmeta.c)
AM_INIT_AUTOMAKE(pngmeta, [1.11])
AC_PREREQ(2.12)
dnl Checks for programs.
AC_PROG_CC
# Allow use of libpng and zlib from raw distributions
AC_ARG_WITH(zlib,
[ --with-zlib=DIR DIR is root for libz distribution])
if test "X$with_zlib" = "X"; then
AC_MSG_CHECKING(for installed zlib)
oLIBS="$LIBS"
LIBS="$LIBS -lz"
AC_TRY_LINK([#include <zlib.h>], [z_streamp zstream; char *s=zlibVersion();],
with_zlib=default
AC_MSG_RESULT(yes),
AC_MSG_RESULT(no))
LIBS="$oLIBS"
else
AC_MSG_CHECKING(for local copy of zlib distribution)
AC_MSG_RESULT($with_zlib)
fi
if test "X$with_zlib" = "X"; then
AC_MSG_CHECKING(for local copy of zlib distribution)
for dir in zlib-[0-9]* zlib ../zlib-[0-9]* ../zlib; do
if test -d $dir -a -f $dir/zlib.h; then
with_zlib=$dir
break
fi
done
if test "X$with_zlib" != "X"; then
AC_MSG_RESULT($with_zlib)
ZLIB_INCLUDE=$with_zlib
else
AC_MSG_RESULT(no)
fi
fi
if test $with_zlib != default; then
LIBS="$LIBS -L$with_zlib"
CFLAGS="$CFLAGS -I$with_zlib"
fi
AC_ARG_WITH(png,
[ --with-png=DIR DIR is root for libpng distribution])
if test "X$with_png" = "X"; then
AC_MSG_CHECKING(for installed libpng)
oLIBS="$LIBS"
LIBS="$LIBS -lpng"
AC_TRY_LINK([#include <png.h>], [png_structp png_ptr; png_infop info_ptr; info_ptr = png_create_info_struct(png_ptr); ],
with_png=default
AC_MSG_RESULT(yes),
LIBS="$oLIBS"
AC_MSG_RESULT(no))
else
AC_MSG_CHECKING(for local copy of libpng distribution)
AC_MSG_RESULT($with_png)
fi
if test "X$with_png" = "X"; then
AC_MSG_CHECKING(for local copy of libpng distribution)
for dir in libpng-[0-9]* libpng ../libpng-[0-9]* ../libpng; do
if test -d $dir -a -f $dir/png.h; then
with_png=$dir
break
fi
done
if test "X$with_png" != "X"; then
AC_MSG_RESULT($with_png)
PNG_INCLUDE=$with_png
else
AC_MSG_RESULT(no)
fi
fi
if test $with_png != default; then
LIBS="$LIBS -L$with_png -lpng"
CFLAGS="$CFLAGS -I$with_png"
fi
dnl Checks for libraries.
# Allow use of libpng and zlib from installed areas
AC_ARG_WITH(zlib_lib,
[ --with-zlib-lib=LIB LIB is path to libz.a])
if test "X$with_zlib_lib" != "X"; then
LIBS="$LIBS -L$with_zlib_lib"
fi
AC_CHECK_LIB(z, zlibVersion, [],
[ AC_MSG_ERROR(could not find libz)]
)
# libpng always needs this
LIBS="$LIBS -lm"
AC_ARG_WITH(png_lib,
[ --with-png-lib=LIB LIB is path to libpng.a])
if test "X$with_png_lib" != "X"; then
LIBS="$LIBS -L$with_png_lib"
fi
AC_CHECK_LIB(png, png_create_read_struct, [],
[ AC_MSG_ERROR(could not find libpng)]
)
dnl Checks for header files.
AC_ARG_WITH(png-includes,
[ --with-png-includes=DIR DIR is path where PNG header files can be found])
if test "X$with_png" = X; then
AC_MSG_CHECKING(for location of png includes)
if test "X$PNG_INCLUDE" = X; then
if test "X$with_png_includes" != "X"; then
PNG_INCLUDE=$with_png_includes
fi
fi
if test ! -f "$PNG_INCLUDE/png.h"; then
AC_MSG_ERROR(could not find png.h in $PNG_INCLUDE)
fi
if test ! -f "$PNG_INCLUDE/pngconf.h"; then
AC_MSG_ERROR(could not find pngconf.h in $PNG_INCLUDE)
fi
AC_MSG_RESULT($PNG_INCLUDE)
CFLAGS="-I$(PNG_INCLUDE) $(CFLAGS)"
fi
AC_ARG_WITH(zlib-includes,
[ --with-zlib-includes=DIR DIR is path where ZLIB header files can be found])
if test "X$with_zlib" = X; then
AC_MSG_CHECKING(for location of zlib includes)
if test "X$with_zlib_includes" != "X"; then
ZLIB_INCLUDE=$with_zlib_includes
fi
if test ! -f "$ZLIB_INCLUDE/zlib.h"; then
AC_MSG_ERROR(could not find zlib.h in $ZLIB_INCLUDE)
fi
if test ! -f "$ZLIB_INCLUDE/zconf.h"; then
AC_MSG_ERROR(could not find zconf.h in $ZLIB_INCLUDE)
fi
AC_MSG_RESULT($ZLIB_INCLUDE)
CFLAGS="-I$(PNG_INCLUDE) $(CFLAGS)"
fi
## I have no idea why autoconf makes me need to do this.
## Of course on M$DOS it should be .exe
EXEEXT=
AC_SUBST(EXEEXT)
dnl Checks for typedefs, structures, and compiler characteristics.
dnl Checks for library functions.
AC_CHECK_FUNCS([png_create_read_struct png_get_text])
AC_OUTPUT([Makefile config.h pngmeta.spec])

BIN
ct1n0g04.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 796 B

BIN
ctzn0g04.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 757 B

251
install-sh Executable file
View File

@@ -0,0 +1,251 @@
#!/bin/sh
#
# install - install a program, script, or datafile
# This comes from X11R5 (mit/util/scripts/install.sh).
#
# Copyright 1991 by the Massachusetts Institute of Technology
#
# Permission to use, copy, modify, distribute, and sell this software and its
# documentation for any purpose is hereby granted without fee, provided that
# the above copyright notice appear in all copies and that both that
# copyright notice and this permission notice appear in supporting
# documentation, and that the name of M.I.T. not be used in advertising or
# publicity pertaining to distribution of the software without specific,
# written prior permission. M.I.T. makes no representations about the
# suitability of this software for any purpose. It is provided "as is"
# without express or implied warranty.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch. It can only install one file at a time, a restriction
# shared with many OS's install programs.
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"
# put in absolute paths if you don't have them in your path; or use env. vars.
mvprog="${MVPROG-mv}"
cpprog="${CPPROG-cp}"
chmodprog="${CHMODPROG-chmod}"
chownprog="${CHOWNPROG-chown}"
chgrpprog="${CHGRPPROG-chgrp}"
stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"
transformbasename=""
transform_arg=""
instcmd="$mvprog"
chmodcmd="$chmodprog 0755"
chowncmd=""
chgrpcmd=""
stripcmd=""
rmcmd="$rmprog -f"
mvcmd="$mvprog"
src=""
dst=""
dir_arg=""
while [ x"$1" != x ]; do
case $1 in
-c) instcmd="$cpprog"
shift
continue;;
-d) dir_arg=true
shift
continue;;
-m) chmodcmd="$chmodprog $2"
shift
shift
continue;;
-o) chowncmd="$chownprog $2"
shift
shift
continue;;
-g) chgrpcmd="$chgrpprog $2"
shift
shift
continue;;
-s) stripcmd="$stripprog"
shift
continue;;
-t=*) transformarg=`echo $1 | sed 's/-t=//'`
shift
continue;;
-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
shift
continue;;
*) if [ x"$src" = x ]
then
src=$1
else
# this colon is to work around a 386BSD /bin/sh bug
:
dst=$1
fi
shift
continue;;
esac
done
if [ x"$src" = x ]
then
echo "install: no input file specified"
exit 1
else
true
fi
if [ x"$dir_arg" != x ]; then
dst=$src
src=""
if [ -d $dst ]; then
instcmd=:
chmodcmd=""
else
instcmd=mkdir
fi
else
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if [ -f $src -o -d $src ]
then
true
else
echo "install: $src does not exist"
exit 1
fi
if [ x"$dst" = x ]
then
echo "install: no destination specified"
exit 1
else
true
fi
# If destination is a directory, append the input filename; if your system
# does not like double slashes in filenames, you may need to add some logic
if [ -d $dst ]
then
dst="$dst"/`basename $src`
else
true
fi
fi
## this sed command emulates the dirname command
dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
# Make sure that the destination directory exists.
# this part is taken from Noah Friedman's mkinstalldirs script
# Skip lots of stat calls in the usual case.
if [ ! -d "$dstdir" ]; then
defaultIFS='
'
IFS="${IFS-${defaultIFS}}"
oIFS="${IFS}"
# Some sh's can't handle IFS=/ for some reason.
IFS='%'
set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
IFS="${oIFS}"
pathcomp=''
while [ $# -ne 0 ] ; do
pathcomp="${pathcomp}${1}"
shift
if [ ! -d "${pathcomp}" ] ;
then
$mkdirprog "${pathcomp}"
else
true
fi
pathcomp="${pathcomp}/"
done
fi
if [ x"$dir_arg" != x ]
then
$doit $instcmd $dst &&
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
else
# If we're going to rename the final executable, determine the name now.
if [ x"$transformarg" = x ]
then
dstfile=`basename $dst`
else
dstfile=`basename $dst $transformbasename |
sed $transformarg`$transformbasename
fi
# don't allow the sed command to completely eliminate the filename
if [ x"$dstfile" = x ]
then
dstfile=`basename $dst`
else
true
fi
# Make a temp file name in the proper directory.
dsttmp=$dstdir/#inst.$$#
# Move or copy the file name to the temp name
$doit $instcmd $src $dsttmp &&
trap "rm -f ${dsttmp}" 0 &&
# and set any options; do chmod last to preserve setuid bits
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $instcmd $src $dsttmp" command.
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
# Now rename the file to the real destination.
$doit $rmcmd -f $dstdir/$dstfile &&
$doit $mvcmd $dsttmp $dstdir/$dstfile
fi &&
exit 0

190
missing Executable file
View File

@@ -0,0 +1,190 @@
#! /bin/sh
# Common stub for a few missing GNU programs while installing.
# Copyright (C) 1996, 1997 Free Software Foundation, Inc.
# Franc,ois Pinard <pinard@iro.umontreal.ca>, 1996.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
if test $# -eq 0; then
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
fi
case "$1" in
-h|--h|--he|--hel|--help)
echo "\
$0 [OPTION]... PROGRAM [ARGUMENT]...
Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
error status if there is no known handling for PROGRAM.
Options:
-h, --help display this help and exit
-v, --version output version information and exit
Supported PROGRAM values:
aclocal touch file \`aclocal.m4'
autoconf touch file \`configure'
autoheader touch file \`config.h.in'
automake touch all \`Makefile.in' files
bison create \`y.tab.[ch]', if possible, from existing .[ch]
flex create \`lex.yy.c', if possible, from existing .c
lex create \`lex.yy.c', if possible, from existing .c
makeinfo touch the output file
yacc create \`y.tab.[ch]', if possible, from existing .[ch]"
;;
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
echo "missing - GNU libit 0.0"
;;
-*)
echo 1>&2 "$0: Unknown \`$1' option"
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
;;
aclocal)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified \`acinclude.m4' or \`configure.in'. You might want
to install the \`Automake' and \`Perl' packages. Grab them from
any GNU archive site."
touch aclocal.m4
;;
autoconf)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified \`configure.in'. You might want to install the
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
archive site."
touch configure
;;
autoheader)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified \`acconfig.h' or \`configure.in'. You might want
to install the \`Autoconf' and \`GNU m4' packages. Grab them
from any GNU archive site."
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' configure.in`
test -z "$files" && files="config.h"
touch_files=
for f in $files; do
case "$f" in
*:*) touch_files="$touch_files "`echo "$f" |
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
*) touch_files="$touch_files $f.in";;
esac
done
touch $touch_files
;;
automake)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified \`Makefile.am', \`acinclude.m4' or \`configure.in'.
You might want to install the \`Automake' and \`Perl' packages.
Grab them from any GNU archive site."
find . -type f -name Makefile.am -print |
sed 's/\.am$/.in/' |
while read f; do touch "$f"; done
;;
bison|yacc)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified a \`.y' file. You may need the \`Bison' package
in order for those modifications to take effect. You can get
\`Bison' from any GNU archive site."
rm -f y.tab.c y.tab.h
if [ $# -ne 1 ]; then
eval LASTARG="\${$#}"
case "$LASTARG" in
*.y)
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
if [ -f "$SRCFILE" ]; then
cp "$SRCFILE" y.tab.c
fi
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
if [ -f "$SRCFILE" ]; then
cp "$SRCFILE" y.tab.h
fi
;;
esac
fi
if [ ! -f y.tab.h ]; then
echo >y.tab.h
fi
if [ ! -f y.tab.c ]; then
echo 'main() { return 0; }' >y.tab.c
fi
;;
lex|flex)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified a \`.l' file. You may need the \`Flex' package
in order for those modifications to take effect. You can get
\`Flex' from any GNU archive site."
rm -f lex.yy.c
if [ $# -ne 1 ]; then
eval LASTARG="\${$#}"
case "$LASTARG" in
*.l)
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
if [ -f "$SRCFILE" ]; then
cp "$SRCFILE" lex.yy.c
fi
;;
esac
fi
if [ ! -f lex.yy.c ]; then
echo 'main() { return 0; }' >lex.yy.c
fi
;;
makeinfo)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified a \`.texi' or \`.texinfo' file, or any other file
indirectly affecting the aspect of the manual. The spurious
call might also be the consequence of using a buggy \`make' (AIX,
DU, IRIX). You might want to install the \`Texinfo' package or
the \`GNU make' package. Grab either from any GNU archive site."
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
if test -z "$file"; then
file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
fi
touch $file
;;
*)
echo 1>&2 "\
WARNING: \`$1' is needed, and you do not seem to have it handy on your
system. You might have modified some files without having the
proper tools for further handling them. Check the \`README' file,
it often tells you about the needed prerequirements for installing
this package. You may also peek at any GNU archive site, in case
some other package would contain this missing \`$1' program."
exit 1
;;
esac
exit 0

40
mkinstalldirs Executable file
View File

@@ -0,0 +1,40 @@
#! /bin/sh
# mkinstalldirs --- make directory hierarchy
# Author: Noah Friedman <friedman@prep.ai.mit.edu>
# Created: 1993-05-16
# Public domain
# $Id: mkinstalldirs,v 1.13 1999/01/05 03:18:55 bje Exp $
errstatus=0
for file
do
set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
shift
pathcomp=
for d
do
pathcomp="$pathcomp$d"
case "$pathcomp" in
-* ) pathcomp=./$pathcomp ;;
esac
if test ! -d "$pathcomp"; then
echo "mkdir $pathcomp"
mkdir "$pathcomp" || lasterr=$?
if test ! -d "$pathcomp"; then
errstatus=$lasterr
fi
fi
pathcomp="$pathcomp/"
done
done
exit $errstatus
# mkinstalldirs ends here

138
pngmeta.1 Normal file
View File

@@ -0,0 +1,138 @@
.TH PNGMETA 1 "10 March 1998"
.\"
.\" Manual page for pngmeta - see end of page for copyright
.\"
.\" $Source: /usr/local/cvsroot/png/pngmeta/pngmeta.1,v $
.\"
.\" $Id: pngmeta.1,v 1.5 2001/05/16 14:46:52 cmdjb Exp $
.\"
.SH NAME
pngmeta \- extract metadata from Portable Network Graphics (PNG) image files
.SH SYNOPSIS
.B pngmeta
.RB [ \--soif ]
.RB [ \--html ]
.RB [ \--xrdf ]
.RB [ \--all ]
.RB [ \--quiet ]
.RB [ \--uri\ URI ]
.RI [ filename ]
.SH DESCRIPTION
The
.I pngmeta
filter outputs the metadata from Portable Network Graphics (PNG)
format image files in one of these formats:
.LP
1. Simple key: value
.LP
2. SOIF format (as used by the Harvest system, version 1.4).
.IP
As such it can be used as a Summarizer for the Harvest Essence system.
It could also be used by other indexers to extract data for
indexing PNG images.
.LP
3. HTML page
With each element as an element in a descriptive (DL) list
.LP
4. XML/RDF
With each element as an RDF property on the source URI.
.LP
In the absence of options, the program operates as a filter,
accepting input from stdin and sending output to stdout.
If a single file name is given,
it is assumed to correspond to a PNG file,
and is processed.
.SH FORMAT OPTIONS
.TP
.B \--soif
Format output using (Harvest) SOIF format. This is the default if
the program is called PngImage.sum.
.TP
.B \--html
Format output in HTML, with each field/value as an element in a descriptive
.RB ( DL )
list.
.TP
.B \--xrdf
Format output in RDF/XML, with each field/value as an element in an
rdf:Description block inside the outer rdf:RDF wrapper element.
If an XMLRDFDATA field is found, it is assumed to be RDF/XML content
and is emitted in a second rdf:Description block.
.SH OTHER OPTIONS
.TP
.B \--all
Output all the information about the image size, depth etc. even if
not usually printed.
.TP
.B \--quiet
Suppress the output of the banner for plain text output.
.B \--uri URI
Set the URI that is used for the SOIF and XML/RDF outputs. By
default this will be the filename, or "stdin" if this is the program
is used as a filter.
.TP
.B \--help
Show a usage message
.TP
.B \--version
Show the program and library versions
.SH FILES
.TP 2.2i
.I pngmeta
executable
.SH "SEE ALSO"
.IR gif2png (1),
.IR libpng (3),
.IR pbm (1),
.IR pgm (1),
.IR pngcheck (1),
.IR pngtopnm (1),
.IR pnm (5),
.IR pnmgamma (1),
.IR pnmtopng (1),
.IR ptot (1),
.IR tiff2png (1),
.IR zlib (3)
.LP
For information about Harvest and its SOIF format:
.IP
http://harvest.cs.colorado.edu/
.LP
For
.IR PNG
.IP
http://www.libpng.org/pub/png/
.LP
For
.IR "libpng library:"
.IP
http://www.libpng.org/pub/png/libpng.html
.br
http://libpng.sourceforge.net
.LP
For
.IR zlib - "zlib library"
.IP
http://www.info-zip.org/pub/infozip/zlib/
.br
http://www.mirror.ac.uk/sites/ftp.freesoftware.com/pub/infozip/zlib/
.IP
.SH AUTHORS
Version 1.10.
Dave Beckett, ILRT, University of Bristol, http://purl.org/net/dajobe/
.LP
The
.IR zlib (3)
library required by
.I pngmeta
is copyright (C) 1995-1996 Jean-loup Gailly and Mark Adler.
Some code was modified from the code for the
.IR libpng (3)
library function
.B png_read_end()
which is copyright (c) Guy Eric Schalnat, Andreas Dilger, Glenn
Randers-Pehrson and others -- see the source for details.
.LP
Original UNIX manual page by R. P. C. Rodgers,
U.S. National Library of Medicine (rodgers@nlm.nih.gov).
.\" end of man page

647
pngmeta.c Normal file
View File

@@ -0,0 +1,647 @@
/* pngmeta - PNG metadata filter to text, SOIF or HTML
For libpng 1.0.0 and zlib version 1.1.1 (or later)
tested up to libpng 1.0.5o and zlib 1.1.3
Copyright 1998-2000 Dave Beckett, ILRT, University of Bristol
http://purl.org/net/dajobe/
$Id: pngmeta.c,v 1.12 2001/05/16 14:41:06 cmdjb Exp $
The function png_skip_till_end() is a modified version of
png_read_end() from libpng 1.0.0 by
Guy Eric Schalnat, Group 42, Inc.
Andreas Eric Dilger and Glenn Randers-Pehrson
as well as many others. The original copyright message follows.
*/
/* pngread.c - read a PNG file
*
* libpng 1.0.0
* For conditions of distribution and use, see copyright notice in png.h
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1996, 1997 Andreas Dilger
* Copyright (c) 1998, Glenn Randers-Pehrson
* March 8, 1998
*
* This file contains routines that an application calls directly to
* read a PNG file or stream.
*/
/* png.h - header file for PNG reference library
*
[DJB: edited to just leave COPYRIGHT NOTICE ]
*
* COPYRIGHT NOTICE:
*
* The PNG Reference Library is supplied "AS IS". The Contributing Authors
* and Group 42, Inc. disclaim all warranties, expressed or implied,
* including, without limitation, the warranties of merchantability and of
* fitness for any purpose. The Contributing Authors and Group 42, Inc.
* assume no liability for direct, indirect, incidental, special, exemplary,
* or consequential damages, which may result from the use of the PNG
* Reference Library, even if advised of the possibility of such damage.
*
* Permission is hereby granted to use, copy, modify, and distribute this
* source code, or portions hereof, for any purpose, without fee, subject
* to the following restrictions:
* 1. The origin of this source code must not be misrepresented.
* 2. Altered versions must be plainly marked as such and must not be
* misrepresented as being the original source.
* 3. This Copyright notice may not be removed or altered from any source or
* altered source distribution.
*
* The Contributing Authors and Group 42, Inc. specifically permit, without
* fee, and encourage the use of this source code as a component to
* supporting the PNG file format in commercial products. If you use this
* source code in a product, acknowledgment is not required but would be
* appreciated.
*/
#include <stdio.h>
#include <stdlib.h>
#include <strings.h>
/* Needed to access various internal PNG chunk routines */
#define PNG_INTERNAL
#include <png.h>
#ifdef __TURBOC__
#include <mem.h>
#endif
/* defined so I can write to a file on gui/windowing platforms */
/* #define STDERR stderr */
#ifdef MSDOS
#define STDERR stdout /* for DOS */
#else
#define STDERR stderr
#endif
#define XMLRDF_MAGIC_FIELD "XMLRDFDATA"
void png_skip_till_end PNGARG((png_structp png_ptr, png_infop info));
void html_quote_string PNGARG((FILE *fd, const char *string));
void print_init PNGARG((FILE *fd, int output_type, const char *filename, const char *uri, int quiet));
void print_start_image PNGARG((FILE *fd, int output_type, const char *filename, const char *uri, int quiet));
void print_kv PNGARG((FILE *fd, int output_type, const char *field, const char *value));
void print_end_image PNGARG((FILE *fd, int output_type));
void print_finish PNGARG((FILE *fd, int output_type));
void user_warning_fn PNGARG((png_structp png_ptr, png_const_charp warning_msg));
const char *progname;
/* static - used to store magic RDF field if seen */
static char *xmlrdf_magic_block=NULL;
/* read data, ignoring IDATs, till the end of the png file.
Will not read past the end of the file, will verify the end is
accurate, and will read any comments or time information at the
end of the file, if info is not NULL. */
void
png_skip_till_end(png_structp png_ptr, png_infop info_ptr)
{
png_byte chunk_length[4];
png_uint_32 length;
length=png_ptr->idat_size;
/* Skip IDAT chunks */
do
{
png_crc_finish(png_ptr, length);
png_read_data(png_ptr, chunk_length, 4);
length = png_get_uint_32(chunk_length);
png_reset_crc(png_ptr);
png_crc_read(png_ptr, png_ptr->chunk_name, 4);
} while (!png_memcmp(png_ptr->chunk_name, png_IDAT, 4));
png_ptr->mode |= PNG_AFTER_IDAT;
do
{
if (!png_memcmp(png_ptr->chunk_name, png_IHDR, 4))
png_handle_IHDR(png_ptr, info_ptr, length);
else if (!png_memcmp(png_ptr->chunk_name, png_IDAT, 4))
{
/* Zero length IDATs are legal after the last IDAT has been
* read, but not after other chunks have been read.
*/
if (length > 0 || png_ptr->mode & PNG_AFTER_IDAT)
png_error(png_ptr, "Too many IDAT's found");
else
png_crc_finish(png_ptr, 0);
}
#if defined(PNG_READ_tIME_SUPPORTED)
else if (!png_memcmp(png_ptr->chunk_name, png_tIME, 4))
png_handle_tIME(png_ptr, info_ptr, length);
#endif
#if defined(PNG_READ_tEXt_SUPPORTED)
else if (!png_memcmp(png_ptr->chunk_name, png_tEXt, 4))
png_handle_tEXt(png_ptr, info_ptr, length);
#endif
#if defined(PNG_READ_zTXt_SUPPORTED)
else if (!png_memcmp(png_ptr->chunk_name, png_zTXt, 4))
png_handle_zTXt(png_ptr, info_ptr, length);
#endif
#if defined(PNG_READ_iTXt_SUPPORTED)
else if (!png_memcmp(png_ptr->chunk_name, png_iTXt, 4))
png_handle_iTXt(png_ptr, info_ptr, length);
#endif
else if (!png_memcmp(png_ptr->chunk_name, png_IEND, 4))
png_handle_IEND(png_ptr, info_ptr, length);
else
png_handle_unknown(png_ptr, info_ptr, length);
if (!(png_ptr->mode & PNG_HAVE_IEND)) {
png_read_data(png_ptr, chunk_length, 4);
length = png_get_uint_32(chunk_length);
png_reset_crc(png_ptr);
png_crc_read(png_ptr, png_ptr->chunk_name, 4);
}
} while (!(png_ptr->mode & PNG_HAVE_IEND));
}
#define OUTPUT_TEXT 0
#define OUTPUT_SOIF 1
#define OUTPUT_HTML 2
#define OUTPUT_XRDF 3
void html_quote_string(FILE *fd, const char *string)
{
char c;
char const * p=string;
while ((c = *p++)) {
if (c == '&')
fputs("&amp;", fd);
else if (c== '<')
fputs("&lt;", fd);
else if (c== '>')
fputs("&gt;", fd);
else
fputc(c, fd);
}
}
void print_init(FILE *fd, int output_type, const char *filename,
const char *uri, int quiet)
{
switch (output_type)
{
case OUTPUT_SOIF:
break;
case OUTPUT_HTML:
fputs("<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'blah'>\n", fd);
fputs("<html>\n<head>\n<title>Metadata for ", fd);
html_quote_string(fd, filename);
fputs("</title>\n</head>\n<body>\n\n", fd);
break;
case OUTPUT_XRDF:
fputs("<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'\n", fd);
fputs(" xmlns:png='http://www.w3.org/2000/08/pngmeta#'\n", fd);
fputs(" xmlns:dc='http://purl.org/dc/elements/1.0/'>\n", fd);
break;
default: /* OUTPUT_TEXT */
if (!quiet)
fprintf(fd, "%s: PNG metadata for %s:\n", progname, filename);
}
}
void print_start_image(FILE *fd, int output_type, const char *filename,
const char *uri, int quiet)
{
switch (output_type)
{
case OUTPUT_SOIF:
if (uri)
fprintf(fd, "@FILE { %s\n", uri);
else
fprintf(fd, "@FILE { %s\n", filename);
break;
case OUTPUT_HTML:
fputs("<h1>Metadata for ", fd);
html_quote_string(fd, filename);
fputs("</h1>\n<dl>\n", fd);
break;
case OUTPUT_XRDF:
if (uri)
fprintf(fd, " <png:Image about=\"%s\"\n", uri);
else {
fputs(" <png:Image about=\"", fd);
html_quote_string(fd, filename);
fputs("\">\n", fd);
}
fputs(" <dc:type>image/png</dc:type>\n", fd);
break;
default: /* OUTPUT_TEXT */
break;
}
}
void print_kv(FILE *fd, int output_type, const char *field, const char *value)
{
if (*value)
switch (output_type)
{
case OUTPUT_SOIF:
/* SOIF: "KEY{SIZE}:\tVALUE\n" */
fprintf(fd, "%s{%d}:\t%s\n", field, (int)strlen(value), value);
break;
case OUTPUT_HTML:
/* HTML: <dt>field<br /></dt>\n<dd>value</dd>\n" */
fputs(" <dt>", fd);
html_quote_string(fd, field);
fputs("<br /></dt>\n <dd>", fd);
html_quote_string(fd, value);
fputs("</dd>\n\n", fd);
break;
case OUTPUT_XRDF:
/* RDF: simple flat text properties */
if(strstr(field, XMLRDF_MAGIC_FIELD)) {
xmlrdf_magic_block=(char*)value;
break;
}
/* start tag */
fputs(" <png:", fd);
html_quote_string(fd, field);
fputs(">", fd);
/* If value starts with <RDF, assume it is RDF and don't
HTML escape it */
if (!strncasecmp(value, "<RDF", 4))
fputs(value, fd);
else
html_quote_string(fd, value);
/* end tag */
fputs("</png:", fd);
html_quote_string(fd, field);
fputs(">\n", fd);
break;
default: /* OUTPUT_TEXT */
fprintf(fd, "%s: %s\n", field, value);
}
}
void
print_end_image(FILE *fd, int output_type)
{
switch (output_type)
{
case OUTPUT_SOIF:
break;
case OUTPUT_HTML:
fputs("</dl>\n\n", fd);
break;
case OUTPUT_XRDF:
fputs(" </png:Image>\n", fd);
break;
default: /* OUTPUT_TEXT */
break;
}
}
void print_finish(FILE *fd, int output_type)
{
switch (output_type)
{
case OUTPUT_SOIF:
fputs("}\n", fd);
break;
case OUTPUT_HTML:
fprintf(fd, "<hr /><small>Created by %s V%s</small>\n\n</body>\n</html>\n", progname, VERSION);
break;
case OUTPUT_XRDF:
fprintf(fd, "</rdf:RDF>\n\n<!--Created by %s V%s -->\n", progname, VERSION);
break;
/* case OUTPUT_TEXT / default */
/* do nothing */
}
}
static const char *png_color_type[] = {
"Grayscale",
"Undefined type",
"RGB",
"Palette",
"Grayscale with Alpha",
"Undefined type",
"RGB with Alpha"
};
/* Throw away warnings (die on errors as usual) */
void user_warning_fn (png_structp png_ptr, png_const_charp warning_msg)
{
}
/* MAIN BODY */
int main(int argc, char *argv[])
{
png_structp png_ptr;
png_infop info_ptr;
png_infop end_info;
FILE *in_fp = stdin;
FILE *out_fp = stdout;
const char *pngfile = "stdin";
int output_type = OUTPUT_TEXT;
int quiet = 0;
int all = 0;
int usingfile = 0;
int usage = 0;
int help = 0;
int version = 0;
int i;
char *p;
char *uri= NULL;
#ifdef HAVE_PNG_GET_TEXT
png_textp text_ptr;
int num_text = 0;
#endif
/* Make progname just become the program name, not the full path -
this is file system type specific since / is used as the
separator */
progname = *argv++; argc--;
if((p=strrchr(progname, '/')))
progname=p+1;
/* Automagically output SOIF when this program is called PngImage.sum */
if(!strcmp(progname, "PngImage.sum"))
output_type = OUTPUT_SOIF;
/* Automagically output RDF when this program is called PngImage.rdfsum */
if(!strcmp(progname, "PngImage.rdfsum"))
output_type = OUTPUT_XRDF;
while (*argv) {
char *arg=argv[0];
int l=strlen(arg);
if (*arg != '-')
break;
if(l < 2) {
usage=1;
break;
}
if (arg[0] == '-' && arg[1] != '-') {
arg++;
} else {
/* found '--' or equivalent */
if (l==2) {
argv++;
argc--;
break;
}
arg+=2;
}
if (!strcmp(arg, "soif")) {
output_type = OUTPUT_SOIF;
} else if (!strcmp(arg, "html")) {
output_type = OUTPUT_HTML;
} else if (!strcmp(arg, "xrdf")) {
output_type = OUTPUT_XRDF;
} else if (!strcmp(arg, "quiet")) {
quiet = 1;
} else if (!strcmp(arg, "all")) {
all = 1;
} else if (!strcmp(arg, "help")) {
help = 1;
break;
} else if (!strcmp(arg, "version")) {
version = 1;
break;
} else if (!strcmp(arg, "uri")) {
argv++;
argc--;
if (!argc) {
fprintf(STDERR, "%s: option --uri requires an argument\n", progname);
usage=1;
} else {
uri=*argv;
}
} else {
fprintf(STDERR, "%s: invalid option -- %s\n", progname, arg);
usage = 1;
break;
}
argv++;
argc--;
}
if (!usage && !help && !version) {
if (!argc)
/* nop */;
else if (argc == 1) {
pngfile = *argv;
if (!(in_fp = fopen (pngfile, "rb"))) {
fprintf(STDERR, "%s: Could not open input file %s - ", progname, pngfile);
fflush(STDERR);
perror(NULL);
exit(1);
}
usingfile = 1;
} else {
usage = 1;
}
}
if(usage) {
fprintf(STDERR, "Try `%s --help' for more information\n", progname);
exit(1);
}
if (help || version) {
fprintf(STDERR, "%s %s (built with libpng %s and zlib %s)\n", progname, VERSION, PNG_LIBPNG_VER_STRING, ZLIB_VERSION);
if (help) {
fprintf(STDERR, "USAGE: %s [OPTIONS]... FILE\n", progname);
fprintf(STDERR, "Display metadata information from a PNG image in FILE\n\n");
fprintf(STDERR, " --all output information about image size etc.\n");
fprintf(STDERR, " --html format output in HTML format\n");
fprintf(STDERR, " --quiet suppress output of banner\n");
fprintf(STDERR, " --soif format output in SOIF format\n");
fprintf(STDERR, " --uri URI set the URI for SOIF and XML/RDF formats\n");
fprintf(STDERR, " --xrdf format output in XML/RDF format\n");
fprintf(STDERR, " --help display this help and exit\n");
fprintf(STDERR, " --version output version information and exit\n");
fprintf(STDERR, "\nCopyright 1998-2000 Dave Beckett, ILRT, University of Bristol\nhttp://purl.org/net/dajobe/\n");
}
exit(1);
}
png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING,
(void*)NULL, NULL, user_warning_fn);
if (!png_ptr) {
fprintf(STDERR, "%s: libpng failed to create read structure\n", progname);
exit(1);
}
info_ptr = png_create_info_struct(png_ptr);
if (!info_ptr)
{
png_destroy_read_struct(&png_ptr, (png_infopp)NULL, (png_infopp)NULL);
fprintf(STDERR, "%s: libpng failed to create info structure\n", progname);
exit(1);
}
/* This is necessary to zero text pointers */
end_info = png_create_info_struct(png_ptr);
if (!end_info)
{
png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp)NULL);
fprintf(STDERR, "%s: libpng failed to create end info structure\n", progname);
exit(1);
}
if (setjmp(png_ptr->jmpbuf))
{
png_destroy_read_struct(&png_ptr, &info_ptr, &end_info);
fprintf(STDERR, "%s: libpng read error for %s\n", progname, pngfile);
fclose(in_fp);
exit(1);
}
/* Initialise data input */
png_init_io(png_ptr, in_fp);
png_read_info(png_ptr, info_ptr);
print_init(out_fp, output_type, pngfile, uri, quiet);
print_start_image(out_fp, output_type, pngfile, uri, quiet);
if (output_type == OUTPUT_SOIF || all) {
/*
Harvest V1.4 GIF summarizer outputs this:
image-format: GIF87|GIF89
image-colors: [bits-per-pixel]
Comment: [GIF Comment Extension text]
image-width: [w]
image-height: [h]
image-type: interlaced|non-interlaced
thumbnail-data: [data for 64x64 GIF image]
The latter is done via:
giftopnm giffile | pnmscale -width 64 -height 64 | ppmquant 256 | ppmtogif
*/
char value[80]; /* Sorry for the fixed-size buffer (big enough) */
print_kv(out_fp, output_type, "image-format", "PNG");
sprintf(value, "%d", info_ptr->bit_depth);
print_kv(out_fp, output_type, "image-colors", value);
sprintf(value, "%ld", info_ptr->width);
print_kv(out_fp, output_type, "image-width", value);
sprintf(value, "%ld", info_ptr->height);
print_kv(out_fp, output_type, "image-height", value);
sprintf(value, "%s, %sinterlaced",
(info_ptr->color_type>6) ? png_color_type[1] : png_color_type[info_ptr->color_type],
info_ptr->interlace_type ? "" : "non-");
print_kv(out_fp, output_type, "image-type", value);
}
/* Local function */
png_skip_till_end(png_ptr, end_info);
#ifdef HAVE_PNG_GET_TEXT
if(png_get_text(png_ptr, info_ptr, &text_ptr, &num_text) > 0) {
for (i = 0; i < num_text; i++)
print_kv(out_fp, output_type, text_ptr[i].key, text_ptr[i].text);
}
#else
/* Print text keywords before IDAT */
for (i = 0; i < info_ptr->num_text; i++)
print_kv(out_fp, output_type, info_ptr->text[i].key, info_ptr->text[i].text);
/* Print text keywords after IDAT */
for (i = 0; i < end_info->num_text; i++)
print_kv(out_fp, output_type, end_info->text[i].key, end_info->text[i].text);
#endif
/* Print modification time (tIME chunk) if present */
if (info_ptr->valid & PNG_INFO_tIME)
print_kv(out_fp, output_type, "Modification Time",
png_convert_to_rfc1123(png_ptr, &info_ptr->mod_time));
else if (end_info->valid & PNG_INFO_tIME)
print_kv(out_fp, output_type, "Modification Time",
png_convert_to_rfc1123(png_ptr, &end_info->mod_time));
print_end_image(out_fp, output_type);
/* print rest of RDF/XML stuff */
if(xmlrdf_magic_block && output_type == OUTPUT_XRDF) {
fputs(xmlrdf_magic_block, out_fp);
}
print_finish(out_fp, output_type);
/* Cleanup */
png_read_destroy(png_ptr, info_ptr, end_info);
fclose(in_fp);
exit (0);
}

51
pngmeta.spec Normal file
View File

@@ -0,0 +1,51 @@
#
# pngmeta -- Get Metadata from PNG images
#
%define name pngmeta
%define version 1.11
%define release 1
%define prefix /usr
Summary: Display metadata information from PNG images
Name: %{name}
Version: %{version}
Release: %{release}
Copyright: Freely Distributable
Group: Applications/Graphics
Source: http://purl.org/net/dajobe/software/%{name}-%{version}.tar.gz
Vendor: Dave Beckett <Dave.Beckett@bristol.ac.uk>
URL: http://sourceforge.net/projects/pmt/
Provides: pngmeta
Requires: libpng.so.2 zlib
BuildRoot: /var/tmp/%{name}-%{version}
%description
This small filter program extracts metadata from PNG images and
displays them as either HTML, SOIF, RDF/XML or simple fields and
values.
%prep
rm -rf $RPM_BUILD_ROOT
%setup
%build
%configure --prefix=${prefix}
make
%install
if [ -d $RPM_BUILD_ROOT ]; then rm -rf $RPM_BUILD_ROOT; fi
mkdir -p $RPM_BUILD_ROOT
make DESTDIR=$RPM_BUILD_ROOT install
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%doc NEWS README
%{prefix}/man/man1/pngmeta.1*
%attr (755,root,root) %{prefix}/bin/pngmeta
%changelog

51
pngmeta.spec.in Normal file
View File

@@ -0,0 +1,51 @@
#
# pngmeta -- Get Metadata from PNG images
#
%define name @PACKAGE@
%define version @VERSION@
%define release 1
%define prefix /usr
Summary: Display metadata information from PNG images
Name: %{name}
Version: %{version}
Release: %{release}
Copyright: Freely Distributable
Group: Applications/Graphics
Source: http://purl.org/net/dajobe/software/%{name}-%{version}.tar.gz
Vendor: Dave Beckett <Dave.Beckett@bristol.ac.uk>
URL: http://sourceforge.net/projects/pmt/
Provides: pngmeta
Requires: libpng.so.2 zlib
BuildRoot: /var/tmp/%{name}-%{version}
%description
This small filter program extracts metadata from PNG images and
displays them as either HTML, SOIF, RDF/XML or simple fields and
values.
%prep
rm -rf $RPM_BUILD_ROOT
%setup
%build
%configure --prefix=${prefix}
make
%install
if [ -d $RPM_BUILD_ROOT ]; then rm -rf $RPM_BUILD_ROOT; fi
mkdir -p $RPM_BUILD_ROOT
make DESTDIR=$RPM_BUILD_ROOT install
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%doc NEWS README
%{prefix}/man/man1/pngmeta.1*
%attr (755,root,root) %{prefix}/bin/pngmeta
%changelog

12
test1 Executable file
View File

@@ -0,0 +1,12 @@
#!/bin/sh
echo 'Testing uncompressed text chunk - tEXT (plain format)'
INPUT=ct1n0g04.png
OUTPUT=test1.xpt
for dir in . ..; do
if [ -r $dir/$OUTPUT ]; then
break;
fi
done
here=`pwd`
cd $dir && $here/pngmeta -quiet $INPUT | diff -c $OUTPUT -

11
test1.xpt Normal file
View File

@@ -0,0 +1,11 @@
Title: PngSuite
Author: Willem A.J. van Schaik
(gwillem@ntuvax.ntu.ac.sg)
Copyright: Copyright Willem van Schaik, Singapore 1995
Description: 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: Created on a NeXTstation color using "pnmtopng".
Disclaimer: Freeware.

12
test2 Executable file
View File

@@ -0,0 +1,12 @@
#!/bin/sh
echo 'Testing compressed text chunk - zTXT (SOIF format)'
INPUT=ctzn0g04.png
OUTPUT=test2.xpt
for dir in . ..; do
if [ -r $dir/$OUTPUT ]; then
break;
fi
done
here=`pwd`
cd $dir && $here/pngmeta -soif -quiet $INPUT | diff -c $OUTPUT -

18
test2.xpt Normal file
View File

@@ -0,0 +1,18 @@
@FILE { ctzn0g04.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.
}

12
test3 Executable file
View File

@@ -0,0 +1,12 @@
#!/bin/sh
echo 'Testing HTML output'
INPUT=8859.png
OUTPUT=test3.xpt
for dir in . ..; do
if [ -r $dir/$OUTPUT ]; then
break;
fi
done
here=`pwd`
cd $dir && $here/pngmeta -html -quiet $INPUT | diff -c $OUTPUT -

40
test3.xpt Normal file
View File

@@ -0,0 +1,40 @@
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'blah'>
<html>
<head>
<title>Metadata for 8859.png</title>
</head>
<body>
<h1>Metadata for 8859.png</h1>
<dl>
<dt>Title<br /></dt>
<dd>ISO 8859-1 characters</dd>
<dt>Description<br /></dt>
<dd>Here are all the printable characters from the
ISO Latin-1 coded character set: hex codes 20 to 7E
and A0 to FF. That includes a space (20) and a
non-breaking space (A0).</dd>
<dt>Test data<br /></dt>
<dd>! " # $ % &amp; ' ( ) * + , - . /
0 1 2 3 4 5 6 7 8 9 : ; &lt; = &gt; ?
@ A B C D E F G H I J K L M N O
P Q R S T U V W X Y Z [ \ ] ^ _
` a b c d e f g h i j k l m n o
p q r s t u v w x y z { | } ~
<EFBFBD> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20>
<EFBFBD> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20>
<EFBFBD> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20>
<EFBFBD> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20>
<EFBFBD> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20>
<EFBFBD> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20>
</dd>
</dl>
<hr /><small>Created by pngmeta V1.11</small>
</body>
</html>

12
test4 Executable file
View File

@@ -0,0 +1,12 @@
#!/bin/sh
echo 'Testing RDF/XML output'
INPUT=ct1n0g04.png
OUTPUT=test4.xpt
for dir in . ..; do
if [ -r $dir/$OUTPUT ]; then
break;
fi
done
here=`pwd`
cd $dir && $here/pngmeta -xrdf -quiet $INPUT | diff -c $OUTPUT -

20
test4.xpt Normal file
View File

@@ -0,0 +1,20 @@
<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'
xmlns:png='http://www.w3.org/2000/08/pngmeta#'
xmlns:dc='http://purl.org/dc/elements/1.0/'>
<png:Image about="ct1n0g04.png">
<dc:type>image/png</dc:type>
<png:Title>PngSuite</png:Title>
<png:Author>Willem A.J. van Schaik
(gwillem@ntuvax.ntu.ac.sg)</png:Author>
<png:Copyright>Copyright Willem van Schaik, Singapore 1995</png:Copyright>
<png:Description>A compilation of a set of images created to test the
various color-types of the PNG format. Included are
black&amp;white, color, paletted, with alpha channel, with
transparency formats. All bit-depths allowed according
to the spec are present.</png:Description>
<png:Software>Created on a NeXTstation color using "pnmtopng".</png:Software>
<png:Disclaimer>Freeware.</png:Disclaimer>
</png:Image>
</rdf:RDF>
<!--Created by pngmeta V1.11 -->