xref: /libtiff-4.0.7/contrib/tags/listtif.c (revision bfbc7176)
1 /*
2  * listtif.c -- lists a tiff file.
3  */
4 
5 #include "xtiffio.h"
6 #include <stdlib.h>
7 
main(int argc,char * argv[])8 void main(int argc,char *argv[])
9 {
10 	char *fname="newtif.tif";
11 	int flags;
12 
13 	TIFF *tif=(TIFF*)0;  /* TIFF-level descriptor */
14 
15 	if (argc>1) fname=argv[1];
16 
17 	tif=XTIFFOpen(fname,"r");
18 	if (!tif) goto failure;
19 
20 	/* We want the double array listed */
21 	flags = TIFFPRINT_MYMULTIDOUBLES;
22 
23 	TIFFPrintDirectory(tif,stdout,flags);
24 	XTIFFClose(tif);
25 	exit (0);
26 
27 failure:
28 	printf("failure in listtif\n");
29 	if (tif) XTIFFClose(tif);
30 	exit (-1);
31 }
32 
33 /*
34  * Local Variables:
35  * mode: c
36  * c-basic-offset: 8
37  * fill-column: 78
38  * End:
39  */
40