LFile::EnumTags

#include "ltwrappr.h"

L_INT LFile::EnumTags(uFlags, pLoadOptions)

L_UINT uFlags;

reserved for future use. Pass 0.

pLOADFILEOPTION pLoadOptions;

pointer to optional extended load options

Enumerates all the tags in a file. Currently, only TIFF and Exif files contain tags.

Parameter

Description

uFlags

Flags parameter. Reserved for future use. Pass 0.

pLoadOptions

Pointer to optional extended load options. Pass NULL to use the default load options.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

For multipage TIFF files, you can enumerate the tags from a particular page. Specify the page number on which to enumerate the tags using the pLoadOptions structure. For more information, refer to the LOADFILEOPTION structure.

This function enumerates the standard TIFF tags and the user tags. Standard TIFF tags are less than 32767. User TIFF tags are usually between 32768 and 65535.

To read a tag value, call LFile::ReadTag.

Note that if LFile::EnumTagsCallBack returns a value other than SUCCESS, LFile::EnumTags will stop enumerating the tags and return the value returned by LFile::EnumTagsCallBack as its return value.

Do not attempt to use the LFile::DeleteTag function to delete tags from inside an LFile::EnumTagsCallback callback function. If you want to delete tags that you enumerate, use LFile::EnumTagsCallback to add the tags to a list. Upon returning from LFile::EnumTags, you can delete all the tags from the list.

Required DLLs and Libraries

LTFIL

LFCMP

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Win32, x64.

See Also

Functions:

LFile::ReadTag, LFile::WriteTag, LFileSettings::SetTag, LFileSettings::GetTag, LFile::EnumTagsCallBack, LFile::DeleteTag, LFile::ReadComment, LFile::ReadCommentOffset, LFile::WriteComment, LFileSettings::GetComment, LFileSettings::SetComment, LMemoryFile::ReadComment, LMemoryFile::ReadTag

Topics:

Implementing TIFF Comments and Tags

 

Raster Image Functions: Maintaining File Comments and Tags

Example

This example will read all the user tags from page 1 of "clean.tif".

/*<struct>*/ 
#ifdef LFileChild 
class LFileChild : public LFile 
{ 
   L_INT EnumGeoKeysCallBack(L_UINT16 uTag,L_UINT16 uType,L_UINT32 uCount, L_VOID *pData);  
   L_INT EnumTagsCallBack(L_UINT16 uTag, L_UINT16 uType, L_UINT32 uCount); 
};  
#endif // #ifdef LFileChild 
/*</struct>*/ 
 
L_INT LFileChild::EnumTagsCallBack(L_UINT16 uTag, L_UINT16 uType, L_UINT32 uCount) 
{ 
   L_TCHAR s[100]; 
   wsprintf(s, TEXT("Tag = %d, Type = %d, Count = %d"), uTag, uType, uCount); 
   MessageBox(NULL, s, TEXT("EnumFileTagCallback"), MB_OK); 
   return SUCCESS; 
} 
 
L_INT LFile__EnumTagsExample()  
{ 
   L_INT nRet; 
   LFileChild FileChild; 
 
   FileChild.EnableCallBack(TRUE) ; 
 
   FileChild.SetFileName(MAKE_IMAGE_PATH(TEXT("clean.tif"))) ; 
 
   /* Enumerate the tags */ 
   nRet = FileChild.EnumTags(0, NULL); 
 
   return SUCCESS; 
} 

Help Version 20.0.2020.4.5
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2020 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C++ Class Library Help