LFile::WriteMetaData

Summary

Writes metadata of the specified type to the file specified for this file object.

Syntax

#include "ltwrappr.h"

virtual L_INT LFile::WriteMetaData(uFlags, pSaveFileOption)

Parameters

L_UINT uFlags

Flags that indicate the type of metadata to write. Possible values are:

Value Meaning
METADATA_COMMENTS [0x0001] Write comments.
METADATA_TAGS [0x0002] Write tags.
METADATA_MARKERS [0x0004] Write markers.
METADATA_GEOKEYS [0x0008] Write GeoKeys.
METADATA_ALL [0xFFFF] Write all metadata (tags, comments and markers).

These values can be combined using OR ( | ) or +.

pSAVEFILEOPTION pSaveFileOption

Reserved for future use. Pass NULL.

Returns

Value Meaning
SUCCESS The function was successful.
< 1 An error occurred. Refer to Return Codes.

Comments

LFile::WriteMetaData can be used to update an existing file with comments, tags and/or markers.

Before calling this function, the user should set:

When you add or remove comments or tags, the comments and tags array at the end of the TIFF/Exif image file is re-written. When you modify existing comments or tags, the new value is added to the file and the IFD is modified as necessary. In all of these cases, there is no image recompression.

Some restrictions apply to this function if you use an IFD to indicate to which page to write the metadata. For more information, refer to Loading and Saving Large TIFF/BigTIFF Files.

Required DLLs and Libraries

Platforms

Win32, x64.

See Also

Functions

Topics

Example

L_INT LFile__WriteMetaDataExample() 
{ 
   L_INT nRet; 
   L_INT nVal = 1234; 
   LFile MyFile; 
   LFileSettings MyFileSettings; 
 
   MyFileSettings.SetTag(0x8001, TAG_LONG, 1, &nVal); 
 
   nRet = MyFileSettings.SetComment(CMNT_SZDESC, (unsigned char *) TEXT("Comment written with WriteMetaData"), 37); 
   if(nRet < 0) 
      return nRet; 
 
   MyFile.SetFileName(MAKE_IMAGE_PATH(TEXT("clean.tif"))); 
 
   nRet = MyFile.WriteMetaData(METADATA_ALL, NULL); 
   if(nRet != SUCCESS) 
      return nRet; 
 
   return SUCCESS; 
} 
Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C++ Class Library Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.