ImageGear for C and C++ on Linux v19.10 - Updated
IG_fltr_metad_update_file
API Reference Guide > Core Component API Reference > Core Component Functions Reference > Filter Functions > IG_fltr_metad_update_file

This function creates a new file with an exact copy of the source file's pixel data and with new metadata.

Declaration:

 
Copy Code
AT_ERRCOUNT ACCUAPI IG_fltr_metad_update_file(
   const LPSTR lpszFileNameSrc,
   const LPSTR lpszFileNameDest,
   AT_LMODE lFormatType,
   UINT nPageNumber
);

Arguments:

Name Type Description
lpszFileNameSrc const LPSTR Path and name of the source file. The path can be absolute or relative.
lpszFileNameDest const LPSTR Path and name of the destination file. The path can be absolute or relative. Source and destination file names must be different.
lFormatType AT_LMODE Specifies the format of the source file. See enumIGFormats for possible values and also see Remarks.
nPageNumber UINT Page number for metadata updating.

Return Value:

Returns 0 if successful. Otherwise, returns the number of ImageGear errors that occurred during this function call.

Supported Raster Image Formats:

All pixel formats supported by ImageGear for C and C++.

The function supports the following image file formats:

Example:

 
Copy Code
AT_ERRCOUNT     nErrcount;            // Count of returned errors on stack

nErrcount = IG_fltr_metad_update_file("picture.tif", "picture_new.tif", IG_FORMAT_TIF, 1);

Remarks:

Pixel data is not decoded but copied directly from source to destination file.

The function creates a new file that contains copy of source file data with the new metadata for required page. lFormatType parameter value should be the same as the source file format type. In a multipage file, the rest of pages are copied verbatim from source to destination file. The function obtains new metadata from metadata callback functions LPAFT_IG_METAD_ITEM_SET_CB and LPAFT_IG_METAD_ITEM_ADD_CB.

IG_fltr_metad_update_file() function can be used as follows:

Destination file will receive the copy of the source file, with new metadata for the specified page.

See Also:

Updating Non-Image Data without Loading and Saving the Image