1 diff -c -r pngmeta-1.11.orig/pngmeta.1 pngmeta-1.11/pngmeta.1
2 *** pngmeta-1.11.orig/pngmeta.1 2001-05-16 16:46:52.000000000 +0200
3 --- pngmeta-1.11/pngmeta.1 2008-12-30 19:12:24.000000000 +0100
6 pngmeta \- extract metadata from Portable Network Graphics (PNG) image files
19 pngmeta \- extract metadata from Portable Network Graphics (PNG) image files
27 ! .RB [ \-\-uri\ URI ]
37 Format output using (Harvest) SOIF format. This is the default if
38 the program is called PngImage.sum.
41 Format output in HTML, with each field/value as an element in a descriptive
46 Format output in RDF/XML, with each field/value as an element in an
47 rdf:Description block inside the outer rdf:RDF wrapper element.
48 If an XMLRDFDATA field is found, it is assumed to be RDF/XML content
49 and is emitted in a second rdf:Description block.
53 Output all the information about the image size, depth etc. even if
57 Suppress the output of the banner for plain text output.
59 Set the URI that is used for the SOIF and XML/RDF outputs. By
60 default this will be the filename, or "stdin" if this is the program
67 Show the program and library versions
75 Format output using (Harvest) SOIF format. This is the default if
76 the program is called PngImage.sum.
79 Format output in HTML, with each field/value as an element in a descriptive
84 Format output in RDF/XML, with each field/value as an element in an
85 rdf:Description block inside the outer rdf:RDF wrapper element.
86 If an XMLRDFDATA field is found, it is assumed to be RDF/XML content
87 and is emitted in a second rdf:Description block.
91 Output all the information about the image size, depth etc. even if
95 Suppress the output of the banner for plain text output.
97 Set the URI that is used for the SOIF and XML/RDF outputs. By
98 default this will be the filename, or "stdin" if this is the program
105 Show the program and library versions
110 http://www.libpng.org/pub/png/
113 ! .IR "libpng library:"
115 http://www.libpng.org/pub/png/libpng.html
117 http://libpng.sourceforge.net
120 ! .IR zlib - "zlib library"
122 ! http://www.info-zip.org/pub/infozip/zlib/
124 ! http://www.mirror.ac.uk/sites/ftp.freesoftware.com/pub/infozip/zlib/
128 Dave Beckett, ILRT, University of Bristol, http://purl.org/net/dajobe/
132 http://www.libpng.org/pub/png/
135 ! .IR "libpng library"
137 http://www.libpng.org/pub/png/libpng.html
139 http://libpng.sourceforge.net
144 ! http://www.zlib.net/
148 Dave Beckett, ILRT, University of Bristol, http://purl.org/net/dajobe/
155 is copyright (C) 1995-1996 Jean-loup Gailly and Mark Adler.
156 - Some code was modified from the code for the
160 - which is copyright (c) Guy Eric Schalnat, Andreas Dilger, Glenn
161 - Randers-Pehrson and others -- see the source for details.
163 Original UNIX manual page by R. P. C. Rodgers,
164 U.S. National Library of Medicine (rodgers@nlm.nih.gov).
166 diff -c -r pngmeta-1.11.orig/pngmeta.c pngmeta-1.11/pngmeta.c
167 *** pngmeta-1.11.orig/pngmeta.c 2001-05-16 16:41:06.000000000 +0200
168 --- pngmeta-1.11/pngmeta.c 2008-12-30 19:15:47.000000000 +0100
173 $Id: pngmeta.c,v 1.12 2001/05/16 14:41:06 cmdjb Exp $
175 - The function png_skip_till_end() is a modified version of
176 - png_read_end() from libpng 1.0.0 by
177 - Guy Eric Schalnat, Group 42, Inc.
178 - Andreas Eric Dilger and Glenn Randers-Pehrson
179 - as well as many others. The original copyright message follows.
182 - /* pngread.c - read a PNG file
185 - * For conditions of distribution and use, see copyright notice in png.h
186 - * Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
187 - * Copyright (c) 1996, 1997 Andreas Dilger
188 - * Copyright (c) 1998, Glenn Randers-Pehrson
191 - * This file contains routines that an application calls directly to
192 - * read a PNG file or stream.
195 /* png.h - header file for PNG reference library
207 /* Needed to access various internal PNG chunk routines */
211 #define XMLRDF_MAGIC_FIELD "XMLRDFDATA"
214 - void png_skip_till_end PNGARG((png_structp png_ptr, png_infop info));
215 void html_quote_string PNGARG((FILE *fd, const char *string));
216 void print_init PNGARG((FILE *fd, int output_type, const char *filename, const char *uri, int quiet));
217 void print_start_image PNGARG((FILE *fd, int output_type, const char *filename, const char *uri, int quiet));
218 void print_kv PNGARG((FILE *fd, int output_type, const char *field, const char *value));
220 #define XMLRDF_MAGIC_FIELD "XMLRDFDATA"
223 void html_quote_string PNGARG((FILE *fd, const char *string));
224 + void html_quote_element PNGARG((FILE *fd, const char *string));
225 void print_init PNGARG((FILE *fd, int output_type, const char *filename, const char *uri, int quiet));
226 void print_start_image PNGARG((FILE *fd, int output_type, const char *filename, const char *uri, int quiet));
227 void print_kv PNGARG((FILE *fd, int output_type, const char *field, const char *value));
230 /* static - used to store magic RDF field if seen */
231 static char *xmlrdf_magic_block=NULL;
234 - /* read data, ignoring IDATs, till the end of the png file.
236 - Will not read past the end of the file, will verify the end is
237 - accurate, and will read any comments or time information at the
238 - end of the file, if info is not NULL. */
240 - png_skip_till_end(png_structp png_ptr, png_infop info_ptr)
242 - png_byte chunk_length[4];
243 - png_uint_32 length;
245 - length=png_ptr->idat_size;
247 - /* Skip IDAT chunks */
250 - png_crc_finish(png_ptr, length);
252 - png_read_data(png_ptr, chunk_length, 4);
253 - length = png_get_uint_32(chunk_length);
255 - png_reset_crc(png_ptr);
256 - png_crc_read(png_ptr, png_ptr->chunk_name, 4);
257 - } while (!png_memcmp(png_ptr->chunk_name, png_IDAT, 4));
259 - png_ptr->mode |= PNG_AFTER_IDAT;
263 - if (!png_memcmp(png_ptr->chunk_name, png_IHDR, 4))
264 - png_handle_IHDR(png_ptr, info_ptr, length);
265 - else if (!png_memcmp(png_ptr->chunk_name, png_IDAT, 4))
267 - /* Zero length IDATs are legal after the last IDAT has been
268 - * read, but not after other chunks have been read.
270 - if (length > 0 || png_ptr->mode & PNG_AFTER_IDAT)
271 - png_error(png_ptr, "Too many IDAT's found");
273 - png_crc_finish(png_ptr, 0);
275 - #if defined(PNG_READ_tIME_SUPPORTED)
276 - else if (!png_memcmp(png_ptr->chunk_name, png_tIME, 4))
277 - png_handle_tIME(png_ptr, info_ptr, length);
279 - #if defined(PNG_READ_tEXt_SUPPORTED)
280 - else if (!png_memcmp(png_ptr->chunk_name, png_tEXt, 4))
281 - png_handle_tEXt(png_ptr, info_ptr, length);
283 - #if defined(PNG_READ_zTXt_SUPPORTED)
284 - else if (!png_memcmp(png_ptr->chunk_name, png_zTXt, 4))
285 - png_handle_zTXt(png_ptr, info_ptr, length);
287 - #if defined(PNG_READ_iTXt_SUPPORTED)
288 - else if (!png_memcmp(png_ptr->chunk_name, png_iTXt, 4))
289 - png_handle_iTXt(png_ptr, info_ptr, length);
291 - else if (!png_memcmp(png_ptr->chunk_name, png_IEND, 4))
292 - png_handle_IEND(png_ptr, info_ptr, length);
294 - png_handle_unknown(png_ptr, info_ptr, length);
296 - if (!(png_ptr->mode & PNG_HAVE_IEND)) {
297 - png_read_data(png_ptr, chunk_length, 4);
298 - length = png_get_uint_32(chunk_length);
300 - png_reset_crc(png_ptr);
301 - png_crc_read(png_ptr, png_ptr->chunk_name, 4);
304 - } while (!(png_ptr->mode & PNG_HAVE_IEND));
308 #define OUTPUT_TEXT 0
309 #define OUTPUT_SOIF 1
310 #define OUTPUT_HTML 2
318 + void html_quote_element(FILE *fd, const char *string)
321 + char const * p=string;
328 void print_init(FILE *fd, int output_type, const char *filename,
329 const char *uri, int quiet)
336 ! fprintf(fd, " <png:Image about=\"%s\"\n", uri);
338 ! fputs(" <png:Image about=\"", fd);
339 html_quote_string(fd, filename);
346 ! fprintf(fd, " <png:Image rdf:about=\"%s\">\n", uri);
348 ! fputs(" <png:Image rdf:about=\"", fd);
349 html_quote_string(fd, filename);
357 ! html_quote_string(fd, field);
360 /* If value starts with <RDF, assume it is RDF and don't
365 ! html_quote_element(fd, field);
368 /* If value starts with <RDF, assume it is RDF and don't
374 ! html_quote_string(fd, field);
382 ! html_quote_element(fd, field);
388 print_kv(out_fp, output_type, "image-type", value);
391 - /* Local function */
392 - png_skip_till_end(png_ptr, end_info);
395 #ifdef HAVE_PNG_GET_TEXT
396 if(png_get_text(png_ptr, info_ptr, &text_ptr, &num_text) > 0) {
397 for (i = 0; i < num_text; i++)
404 ! png_read_destroy(png_ptr, info_ptr, end_info);
412 ! png_destroy_read_struct(png_ptr, info_ptr, end_info);
416 Pouze v pngmeta-1.11.orig/: pngmeta.spec
417 diff -c -r pngmeta-1.11.orig/test4.xpt pngmeta-1.11/test4.xpt
418 *** pngmeta-1.11.orig/test4.xpt 2000-08-15 17:39:04.000000000 +0200
419 --- pngmeta-1.11/test4.xpt 2008-12-30 19:12:24.000000000 +0100
422 <rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'
423 xmlns:png='http://www.w3.org/2000/08/pngmeta#'
424 xmlns:dc='http://purl.org/dc/elements/1.0/'>
425 ! <png:Image about="ct1n0g04.png">
426 <dc:type>image/png</dc:type>
427 <png:Title>PngSuite</png:Title>
428 <png:Author>Willem A.J. van Schaik
430 <rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'
431 xmlns:png='http://www.w3.org/2000/08/pngmeta#'
432 xmlns:dc='http://purl.org/dc/elements/1.0/'>
433 ! <png:Image rdf:about="ct1n0g04.png">
434 <dc:type>image/png</dc:type>
435 <png:Title>PngSuite</png:Title>
436 <png:Author>Willem A.J. van Schaik