updated on Fri Jan 20 20:16:25 UTC 2012
[aur-mirror.git] / pmt / pngmeta-1.11-libpng_fixes.diff
blob6ac8ca5fb36cd88a1990e4c8b754cd444d027e5f
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
4 ***************
5 *** 10,21 ****
6 pngmeta \- extract metadata from Portable Network Graphics (PNG) image files
7 .SH SYNOPSIS
8 .B pngmeta
9 ! .RB [ \--soif ]
10 ! .RB [ \--html ]
11 ! .RB [ \--xrdf ]
12 ! .RB [ \--all ]
13 ! .RB [ \--quiet ]
14 ! .RB [ \--uri\ URI ]
15 .RI [ filename ]
16 .SH DESCRIPTION
17 The
18 --- 10,21 ----
19 pngmeta \- extract metadata from Portable Network Graphics (PNG) image files
20 .SH SYNOPSIS
21 .B pngmeta
22 ! .RB [ \-\-soif ]
23 ! .RB [ \-\-html ]
24 ! .RB [ \-\-xrdf ]
25 ! .RB [ \-\-all ]
26 ! .RB [ \-\-quiet ]
27 ! .RB [ \-\-uri\ URI ]
28 .RI [ filename ]
29 .SH DESCRIPTION
30 The
31 ***************
32 *** 44,80 ****
33 and is processed.
34 .SH FORMAT OPTIONS
35 .TP
36 ! .B \--soif
37 Format output using (Harvest) SOIF format. This is the default if
38 the program is called PngImage.sum.
39 .TP
40 ! .B \--html
41 Format output in HTML, with each field/value as an element in a descriptive
42 .RB ( DL )
43 list.
44 .TP
45 ! .B \--xrdf
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.
50 .SH OTHER OPTIONS
51 .TP
52 ! .B \--all
53 Output all the information about the image size, depth etc. even if
54 not usually printed.
55 .TP
56 ! .B \--quiet
57 Suppress the output of the banner for plain text output.
58 ! .B \--uri URI
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
61 is used as a filter.
62 .TP
63 ! .B \--help
64 Show a usage message
65 .TP
66 ! .B \--version
67 Show the program and library versions
68 .SH FILES
69 .TP 2.2i
70 --- 44,80 ----
71 and is processed.
72 .SH FORMAT OPTIONS
73 .TP
74 ! .B \-\-soif
75 Format output using (Harvest) SOIF format. This is the default if
76 the program is called PngImage.sum.
77 .TP
78 ! .B \-\-html
79 Format output in HTML, with each field/value as an element in a descriptive
80 .RB ( DL )
81 list.
82 .TP
83 ! .B \-\-xrdf
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.
88 .SH OTHER OPTIONS
89 .TP
90 ! .B \-\-all
91 Output all the information about the image size, depth etc. even if
92 not usually printed.
93 .TP
94 ! .B \-\-quiet
95 Suppress the output of the banner for plain text output.
96 ! .B \-\-uri URI
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
99 is used as a filter.
101 ! .B \-\-help
102 Show a usage message
104 ! .B \-\-version
105 Show the program and library versions
106 .SH FILES
107 .TP 2.2i
108 ***************
109 *** 104,124 ****
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/
123 ! .br
124 ! http://www.mirror.ac.uk/sites/ftp.freesoftware.com/pub/infozip/zlib/
126 .SH AUTHORS
127 ! Version 1.10.
128 Dave Beckett, ILRT, University of Bristol, http://purl.org/net/dajobe/
131 --- 104,122 ----
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
142 ! .IR "zlib library"
144 ! http://www.zlib.net/
146 .SH AUTHORS
147 ! Version 1.11.
148 Dave Beckett, ILRT, University of Bristol, http://purl.org/net/dajobe/
151 ***************
152 *** 126,137 ****
153 library required by
154 .I pngmeta
155 is copyright (C) 1995-1996 Jean-loup Gailly and Mark Adler.
156 - Some code was modified from the code for the
157 - .IR libpng (3)
158 - library function
159 - .B png_read_end()
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).
165 --- 124,129 ----
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
169 ***************
170 *** 9,35 ****
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
184 - * libpng 1.0.0
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
189 - * March 8, 1998
191 - * This file contains routines that an application calls directly to
192 - * read a PNG file or stream.
193 - */
195 /* png.h - header file for PNG reference library
198 --- 9,16 ----
199 ***************
200 *** 65,70 ****
201 --- 46,52 ----
202 #include <stdio.h>
203 #include <stdlib.h>
204 #include <strings.h>
205 + #include <ctype.h>
207 /* Needed to access various internal PNG chunk routines */
208 #define PNG_INTERNAL
209 ***************
210 *** 86,93 ****
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));
219 --- 68,75 ----
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));
228 ***************
229 *** 102,182 ****
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. */
239 - void
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 */
248 - do
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;
261 - do
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.
269 - */
270 - if (length > 0 || png_ptr->mode & PNG_AFTER_IDAT)
271 - png_error(png_ptr, "Too many IDAT's found");
272 - else
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);
278 - #endif
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);
282 - #endif
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);
286 - #endif
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);
290 - #endif
291 - else if (!png_memcmp(png_ptr->chunk_name, png_IEND, 4))
292 - png_handle_IEND(png_ptr, info_ptr, length);
293 - else
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
311 --- 84,89 ----
312 ***************
313 *** 200,205 ****
314 --- 107,122 ----
318 + void html_quote_element(FILE *fd, const char *string)
320 + char c;
321 + char const * p=string;
322 + while ((c = *p++))
323 + if (!isspace (c))
324 + fputc(c, fd);
328 void print_init(FILE *fd, int output_type, const char *filename,
329 const char *uri, int quiet)
331 ***************
332 *** 248,256 ****
334 case OUTPUT_XRDF:
335 if (uri)
336 ! fprintf(fd, " <png:Image about=\"%s\"\n", uri);
337 else {
338 ! fputs(" <png:Image about=\"", fd);
339 html_quote_string(fd, filename);
340 fputs("\">\n", fd);
342 --- 165,173 ----
344 case OUTPUT_XRDF:
345 if (uri)
346 ! fprintf(fd, " <png:Image rdf:about=\"%s\">\n", uri);
347 else {
348 ! fputs(" <png:Image rdf:about=\"", fd);
349 html_quote_string(fd, filename);
350 fputs("\">\n", fd);
352 ***************
353 *** 294,300 ****
355 /* start tag */
356 fputs(" <png:", fd);
357 ! html_quote_string(fd, field);
358 fputs(">", fd);
360 /* If value starts with <RDF, assume it is RDF and don't
361 --- 211,217 ----
363 /* start tag */
364 fputs(" <png:", fd);
365 ! html_quote_element(fd, field);
366 fputs(">", fd);
368 /* If value starts with <RDF, assume it is RDF and don't
369 ***************
370 *** 306,312 ****
372 /* end tag */
373 fputs("</png:", fd);
374 ! html_quote_string(fd, field);
375 fputs(">\n", fd);
376 break;
378 --- 223,229 ----
380 /* end tag */
381 fputs("</png:", fd);
382 ! html_quote_element(fd, field);
383 fputs(">\n", fd);
384 break;
386 ***************
387 *** 599,608 ****
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++)
398 --- 516,521 ----
399 ***************
400 *** 639,645 ****
403 /* Cleanup */
404 ! png_read_destroy(png_ptr, info_ptr, end_info);
406 fclose(in_fp);
408 --- 552,558 ----
411 /* Cleanup */
412 ! png_destroy_read_struct(png_ptr, info_ptr, end_info);
414 fclose(in_fp);
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
420 ***************
421 *** 1,7 ****
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
429 --- 1,7 ----
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