L_WriteFileComment

#include "l_bitmap.h"

L_LTFIL_API L_INT L_WriteFileComment(pszFile, pSaveOptions)

Writes comments to an existing file.

Parameters

L_TCHAR* pszFile

Character string that contains the filename.

pSAVEFILEOPTION pSaveOptions

Pointer to optional extended save options. Pass NULL to use the default save options. pSaveOptions.PageNumber indicates the page on which to write the comments.

Returns

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

Comments

This function only applies to TIF, EXIF, JPEG, JPEG2000 or FPX files.

This function can be used to write TIFF comments without saving an image. It will also write all the comments set using the L_SetComment function. These are the same comments that will be written the next time a TIFF page is saved. For more information on saving files, refer to L_SaveFile. For more information on setting comments, refer to L_SetComment.

Comments to be written to a file may be passed directly to L_WriteFileCommentExt.

When you add or remove comments or tags, the comments and tags array at the end of the 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 comments. See the Loading and Saving Large TIFF/BigTIFF Files topic for more information.

Required DLLs and Libraries

Platforms

Win32, x64, Linux.

See Also

Functions

Topics

Example

#define COMMENT "ME" 
 
L_INT WriteFileCommentExample(L_VOID) 
{ 
   L_INT nRet; 
   SAVEFILEOPTION  SaveFileOption; 
 
   /* Set the tag data to be saved */ 
   nRet = L_SetComment(CMNT_SZARTIST,(L_UCHAR *)COMMENT, 3); 
   if(nRet < SUCCESS) 
      return nRet; 
 
   nRet = L_GetDefaultSaveFileOption(&SaveFileOption, sizeof(SAVEFILEOPTION)); 
   if(nRet != SUCCESS) 
      return nRet; 
   SaveFileOption.PageNumber = 1; 
 
   /* Save the new comment to the file . */  
   nRet = L_WriteFileComment(MAKE_IMAGE_PATH(TEXT("TEST.TIF")), &SaveFileOption); 
   if(nRet != SUCCESS) 
      return nRet; 
 
   /* Now select the file in the main demo and click on FileInfo.  
     "Me" should appear in the artist field */ 
   return SUCCESS; 
} 
Help Version 20.0.2020.4.3
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2020 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C API Help