tiffset: Add support for LONG8, SLONG8 and IFD8 field types

This commit is contained in:
Roger Leigh 2018-03-07 16:40:23 +00:00 committed by Roger Leigh
parent 7a092f8af2
commit 43586d4105

View File

@ -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++]));