[OSGeo-Discuss] Re: any library for modifying TIFF tags ?

Sumanth sumanthpavuluri at gmail.com
Wed Jul 20 16:35:22 PDT 2011


Hi,

I'm having a similar problem that Jachym has posted.

I try to add custom tag to Tiff files using LIBTIFF3.

I modified as below:

tiff.h:
#define	TIFFTAG_ADLDETECTIONINFO	 32772

tiff_dirinfo.c

{ TIFFTAG_ADLDETECTIONINFO, -1,-1,	TIFF_BYTE,	FIELD_CUSTOM,
      1,	0,	"ADLDetectionInfo" },

I'm trying to add the custom tag in append mode as below:

static int WriteTiffTag(const T* pImg, int iWidth, int iHeight,const char*
sFilePath, int tiffTag, const char* tagValue = 0)
	{


		//load the file
        
		CTiffPtr tiffPtr(sFilePath, "a");

		//set the field value
		int noErr = TIFFSetField(tiffPtr.GetPtr(), tiffTag, tagValue);
			
            if( noErr != 1 )
			{
				printf( "%s setting TIFF Fields failed \n", __FUNCTION__);
				fflush(stdout);
				return -1;
			}


When I open the tiff image using AsTiffTagViewer I don't see the custom tag
added to the tiff image.

Can someone please help me with this?

Thanks!




--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/any-library-for-modifying-TIFF-tags-tp3092830p6604904.html
Sent from the OSGeo Discuss mailing list archive at Nabble.com.



More information about the Discuss mailing list