diff options
author | fwarmerdam <fwarmerdam> | 2012-05-24 02:29:06 +0000 |
---|---|---|
committer | fwarmerdam <fwarmerdam> | 2012-05-24 02:29:06 +0000 |
commit | 0326e06a5dc708b2e7dcb2ce5b37a4fd5401e90c (patch) | |
tree | 9c15e67f87f3ab6baff53acdb990ae660e02a6ad | |
parent | 88796dafa881d683323f2461656adfc85eb22fb5 (diff) | |
download | libtiff-0326e06a5dc708b2e7dcb2ce5b37a4fd5401e90c.tar.gz |
be careful about whether min/max values per singular or per sample
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | libtiff/tif_print.c | 8 |
2 files changed, 8 insertions, 3 deletions
@@ -1,5 +1,8 @@ 2012-05-23 Frank Warmerdam <warmerdam@google.com> + * libtiff/tif_print.c: be careful about whether min/max values are singular + or one per sample. + * libtiff/tif_print.c: Avoid confusion about count size when printing custom fields. May affect things like ISOSpeedRatings. diff --git a/libtiff/tif_print.c b/libtiff/tif_print.c index b80358c1..9af11f6c 100644 --- a/libtiff/tif_print.c +++ b/libtiff/tif_print.c @@ -1,4 +1,4 @@ -/* $Id: tif_print.c,v 1.55 2012-05-24 01:40:25 fwarmerdam Exp $ */ +/* $Id: tif_print.c,v 1.56 2012-05-24 02:29:06 fwarmerdam Exp $ */ /* * Copyright (c) 1988-1997 Sam Leffler @@ -449,14 +449,16 @@ TIFFPrintDirectory(TIFF* tif, FILE* fd, long flags) if (TIFFFieldSet(tif,FIELD_MAXSAMPLEVALUE)) fprintf(fd, " Max Sample Value: %u\n", td->td_maxsamplevalue); if (TIFFFieldSet(tif,FIELD_SMINSAMPLEVALUE)) { + int count = (tif->tif_flags & TIFF_PERSAMPLE) ? td->td_samplesperpixel : 1; fprintf(fd, " SMin Sample Value:"); - for (i = 0; i < td->td_samplesperpixel; ++i) + for (i = 0; i < count; ++i) fprintf(fd, " %g", td->td_sminsamplevalue[i]); fprintf(fd, "\n"); } if (TIFFFieldSet(tif,FIELD_SMAXSAMPLEVALUE)) { + int count = (tif->tif_flags & TIFF_PERSAMPLE) ? td->td_samplesperpixel : 1; fprintf(fd, " SMax Sample Value:"); - for (i = 0; i < td->td_samplesperpixel; ++i) + for (i = 0; i < count; ++i) fprintf(fd, " %g", td->td_smaxsamplevalue[i]); fprintf(fd, "\n"); } |