Merge branch 'issue-18' into 'master'

tiffset: pass size for TIFFTAG_INKNAMES

Closes #18

See merge request libtiff/libtiff!146
This commit is contained in:
Even Rouault 2020-04-19 18:32:25 +00:00
commit 1b4708f67f

View File

@ -321,6 +321,7 @@ main(int argc, char* argv[])
const TIFFField *fip; const TIFFField *fip;
char *text; char *text;
size_t len; size_t len;
int ret;
arg_index++; arg_index++;
fip = GetField(tiff, argv[arg_index]); fip = GetField(tiff, argv[arg_index]);
@ -354,7 +355,12 @@ main(int argc, char* argv[])
fclose( fp ); fclose( fp );
if(TIFFSetField( tiff, TIFFFieldTag(fip), text ) != 1) { if(TIFFFieldPassCount( fip )) {
ret = TIFFSetField( tiff, TIFFFieldTag(fip), (uint16)len, text );
} else {
ret = TIFFSetField( tiff, TIFFFieldTag(fip), text );
}
if(!ret) {
fprintf(stderr, "Failed to set %s from file %s\n", fprintf(stderr, "Failed to set %s from file %s\n",
TIFFFieldName(fip), argv[arg_index]); TIFFFieldName(fip), argv[arg_index]);
} }