Applied TIFFWriteNormalTag() patch from Martin McBride for BYTE tags.

This commit is contained in:
Frank Warmerdam 1999-08-18 12:38:55 +00:00
parent 23f6dabba3
commit 6a661313c1

View File

@ -1,4 +1,4 @@
/* $Header: /cvs/maptools/cvsroot/libtiff/libtiff/tif_dirwrite.c,v 1.1 1999-07-27 21:50:27 mike Exp $ */
/* $Header: /cvs/maptools/cvsroot/libtiff/libtiff/tif_dirwrite.c,v 1.2 1999-08-18 12:38:55 warmerda Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
@ -474,6 +474,27 @@ TIFFWriteNormalTag(TIFF* tif, TIFFDirEntry* dir, const TIFFFieldInfo* fip)
return (0);
}
break;
/* added based on patch request from MARTIN.MCBRIDE.MM@agfa.co.uk,
correctness not verified (FW, 99/08) */
case TIFF_BYTE:
if (wc > 1) {
char* cp;
if (wc == (u_short) TIFF_VARIABLE) {
TIFFGetField(tif, fip->field_tag, &wc, &cp);
dir->tdir_count = wc;
} else
TIFFGetField(tif, fip->field_tag, &cp);
if (!TIFFWriteByteArray(tif, dir, cp))
return (0);
} else {
char cv;
TIFFGetField(tif, fip->field_tag, &cv);
if (!TIFFWriteByteArray(tif, dir, &cv))
return (0);
}
break;
case TIFF_UNDEFINED:
{ char* cp;
if (wc == (u_short) TIFF_VARIABLE) {