From 43586d41054121e4f0f4439eb4907fd12df6b99f Mon Sep 17 00:00:00 2001 From: Roger Leigh Date: Wed, 7 Mar 2018 16:40:23 +0000 Subject: [PATCH] tiffset: Add support for LONG8, SLONG8 and IFD8 field types --- tools/tiffset.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/tools/tiffset.c b/tools/tiffset.c index 9a75d910..7ecc401b 100644 --- a/tools/tiffset.c +++ b/tools/tiffset.c @@ -188,6 +188,9 @@ main(int argc, char* argv[]) size = 4; break; + case TIFF_LONG8: + case TIFF_SLONG8: + case TIFF_IFD8: case TIFF_DOUBLE: size = 8; break; @@ -224,7 +227,16 @@ main(int argc, char* argv[]) case TIFF_SLONG: case TIFF_IFD: for (i = 0; i < wc; i++) - ((uint32 *)array)[i] = atol(argv[arg_index+i]); + ((int32 *)array)[i] = atol(argv[arg_index+i]); + break; + case TIFF_LONG8: + for (i = 0; i < wc; i++) + ((uint64 *)array)[i] = strtoll(argv[arg_index+i], (char **)NULL, 10); + break; + case TIFF_SLONG8: + case TIFF_IFD8: + for (i = 0; i < wc; i++) + ((int64 *)array)[i] = strtoll(argv[arg_index+i], (char **)NULL, 10); break; case TIFF_DOUBLE: for (i = 0; i < wc; i++) @@ -275,6 +287,12 @@ main(int argc, char* argv[]) ret = TIFFSetField(tiff, TIFFFieldTag(fip), atol(argv[arg_index++])); break; + case TIFF_LONG8: + case TIFF_SLONG8: + case TIFF_IFD8: + ret = TIFFSetField(tiff, TIFFFieldTag(fip), + strtoll(argv[arg_index++], (char **)NULL, 10)); + break; case TIFF_DOUBLE: ret = TIFFSetField(tiff, TIFFFieldTag(fip), atof(argv[arg_index++]));