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

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_W(
   const LPAT_WCHAR lpwszFileNameSrc,
   const LPAT_WCHAR lpwszFileNameDest,
   AT_LMODE lFormatType,
   UINT nPageNumber
);

Arguments:

Name Type Description
lpwszFileNameSrc const LPAT_WCHAR Path and name of the source file, specified as a wide string (UTF-16). The path can be absolute or relative.
lpwszFileNameDest const LPAT_WCHAR Path and name of the destination file, specified as a wide string (UTF-16). 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:

Sample:

None

Example:

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

nErrcount = IG_fltr_metad_update_file_W(L"picture.tif", L"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 a copy of the 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 multi-page file, the rest of the 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.