This function creates a new file with exact copy of 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:
lpszFileNameSrc | Path and name of the source file. The path can be absolute or relative. |
lpszFileNameDest | Path and name of the destination file. The path can be absolute or relative. |
lFormatType | Specifies the format of the source file. See enumIGFormats for possible values. Set to IG_FORMAT_UNKNOWN to let ImageGear detect the format automatically. |
nPageNumber | 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 Professional.
Sample:
Filters
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. Currently only IG_FORMAT_TIF format supports this feature.
TIFF-JPEG format is not supported by this function. |
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, LPAFT_IG_METAD_ITEM_ADD_CB.
IG_fltr_metad_update_file() function can be used as follows:
- Use IG_fltr_pageinfo_get to get metadata for the page into your application's storage;
- Change metadata (add / delete / change metadata tags or metadata values);
- Call IG_fltr_metad_update_file() function, supplying the metadata tags to LPAFT_IG_METAD_ITEM_SET_CB and LPAFT_IG_METAD_ITEM_ADD_CB callbacks. nPageNumber and lFormatType parameter values should correspond to the loaded page and source file format.
Destination file will recieve the copy of the the source file, with new metadata for the specified page.