Callback functions can be used to get and set non-image data during normal load and save operations. It is also possible to use callback functions with the IG_fltr_metad_update_file() function to operate on only the non-image data in a file. This function creates a new file with an exact copy of the source file's pixel data and with new non-image data. Pixel data is not decoded, but is copied directly from the source to the destination file. This function is currently supported with the following file formats only:
- TIFF (except for TIFF-JPEG)
- JPEG
IG_fltr_metad_update_file() obtains new non-image data from the following callback functions:
IG_fltr_metad_update_file() function can be used as follows:
- Load necessary page to get metadata.
- Change metadata (add / delete / change metadata tags or metadata values).
- Call IG_fltr_metad_update_file() function. nPageNumber and lFormatType parameter values should correspond to the loaded page and source file format.
The destination file will be a copy of the source file with the new non-image data for the specified page.
The application may then delete the source file and rename the destination file with the name of the source file.
Usage of metadata update function is demonstrated in the Filter sample. Use the following steps to test this feature:
- Open a TIF image using File/Open menu item.
- Add or modify tag(s) using Image/Metadata/Data Structure dialog.
- Create a file with updated metadata using File/Update metadata menu item. Source file name and page number correspond to the last loaded page in the filter sample.
All changes made in the Metadata dialog will be lost if any function that returns metadata is called before calling IG_fltr_metad_update_file() (i.e., loading a new file, getting file info, or preview). |