From e1f19eab3c0d34cfece01085db0356d575b8140c Mon Sep 17 00:00:00 2001 From: Packit Service Date: Dec 09 2020 09:50:21 +0000 Subject: Apply patch libtiff-tiffinfo-exif.patch patch_name: libtiff-tiffinfo-exif.patch present_in_specfile: true --- diff --git a/tools/tiffinfo.c b/tools/tiffinfo.c index 4d4ae64..95c094e 100644 --- a/tools/tiffinfo.c +++ b/tools/tiffinfo.c @@ -49,7 +49,7 @@ int readdata = 0; /* read data in file */ int stoponerr = 1; /* stop on first read error */ static void usage(void); -static void tiffinfo(TIFF*, uint16, long); +static void tiffinfo(TIFF*, uint16, long, int); int main(int argc, char* argv[]) @@ -124,19 +124,20 @@ main(int argc, char* argv[]) if (tif != NULL) { if (dirnum != -1) { if (TIFFSetDirectory(tif, (tdir_t) dirnum)) - tiffinfo(tif, order, flags); + tiffinfo(tif, order, flags, 1); } else if (diroff != 0) { if (TIFFSetSubDirectory(tif, diroff)) - tiffinfo(tif, order, flags); + tiffinfo(tif, order, flags, 1); } else { do { uint32 offset; - tiffinfo(tif, order, flags); + tiffinfo(tif, order, flags, 1); if (TIFFGetField(tif, TIFFTAG_EXIFIFD, &offset)) { - if (TIFFReadEXIFDirectory(tif, offset)) - tiffinfo(tif, order, flags); + if (TIFFReadEXIFDirectory(tif, offset)) { + tiffinfo(tif, order, flags, 0); + } } } while (TIFFReadDirectory(tif)); } @@ -426,10 +427,10 @@ TIFFReadRawData(TIFF* tif, int bitrev) } static void -tiffinfo(TIFF* tif, uint16 order, long flags) +tiffinfo(TIFF* tif, uint16 order, long flags, int is_image) { TIFFPrintDirectory(tif, stdout, flags); - if (!readdata) + if (!readdata || !is_image) return; if (rawdata) { if (order) {