#include "l_bitmap.h"
L_LTFIL_API L_INT L_EnumFileTags (pszFile, uFlags, pfnCallback, pUserData, pLoadOptions)
Enumerates all the TIFF tags in a file. See the Comments section below for a list of formats which support TIFF tags.
Character string containing the name of the file in which to enumerate the tags.
Flags parameter. Reserved for future use. Pass 0.
Callback function for enumerating each tag. Use the function pointer as the value of this parameter.L_EnumFileTags calls this callback function for each tag. The callback function must adhere to the function prototype described in the ENUMTAGSCALLBACK callback function.
Void pointer that you can use to pass one or more additional parameters that the callback function needs.To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.
Pointer to optional extended load options. Pass NULL to use the default load options.
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
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 L_ReadFileTag.
Note that if ENUMTAGSCALLBACK returns a value other than SUCCESS, L_EnumFileTags will stop enumerating the tags and return the value returned by ENUMTAGSCALLBACK as its return value.
Do not attempt to use the L_DeleteTag function to delete tags from inside an ENUMTAGSCALLBACK callback function. If you want to delete tags that you enumerate, use ENUMTAGSCALLBACK to add the tags to a list. Upon returning from L_EnumFileTags, you can delete all the tags from the list.
For general information about TIFF tags, refer to Implementing TIFF Comments and Tags.
Required DLLs and Libraries
Win32, x64, Linux.
This example will read all the user tags from page 1 of "file.tif".
L_INT EXT_CALLBACK EnumFileTagCallback(L_UINT16 uTag,
L_UINT16 uType,
L_UINT32 uCount,
L_VOID * pUserData)
{
UNREFERENCED_PARAMETER(pUserData);
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 EnumFileTagsExample(HWND hWnd)
{
/* Enumerate the tags */
UNREFERENCED_PARAMETER(hWnd);
return L_EnumFileTags(MAKE_IMAGE_PATH(TEXT("OCR1.tif")), 0, EnumFileTagCallback, NULL, NULL);
}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document