ImageGear Professional for Windows ActiveX
Working with Non-Image Data

Some complex format filters as EXIF-JPEG, EXIF-TIFF, TIFF, JPEG, PNG and some others contain a lot of non-image data generally referred to as metadata. ImageGear provides a mechanism for reading the metadata during image loading and modifying it during image saving. Non-image data itself can be of any possible complex type and completely depends on the nature of the file format. ImageGear processes this complex data through a single interface and allows uniform processing that does not depend on the actual data format and starts from information fields of such simple formats as BMP and PCX, up to the complex metadata support in the EXIF filter and the IPTC non-image data format in such filters as TIFF and JPEG.

For more information, see the EXIF-TIFF Non-Image Data Structure, EXIF-JPEG Non-image Data Structure and the IPTC Non-Image Data Structure sections in Non-Image Data Storage as well as the EXIF-JPEG, EXIF-TIFF sections in the File Format Reference Chapter.

Metadata is stored in the file containing the image. Thus, your application will use functions of IGFormatsCtl Control to access the metadata. Access to the metadata is accomplished via an IGFormatsCtl property, a Global Control Variable, 3 Event Handlers, and a COM object:

IGFormatsCtl Control.Settings.MetaDataEnabled Set this property to True to enable the Event Handler processing. If set to False (the default), then none of the Events will be raised by ImageGear, even if the file being loaded contains metadata.
IGMetadataItem Object This is the COM object. It is passed to the various Event Handlers. Depending on the operation, your application will either read the metadata out of this object, or store the metadata in this object.
FLTR.METADATA_FORMAT This is a Global Control Parameter. Your application must either set it to the string "binary" or "text". If "text", then all metadata values will be AM_TID_META_STRING. If "binary", then each metadata item will be of a different data-type, and your application will have to check the IGMetadataItem Object.ValueType field in order to determine the data-type.
IGMetadataItemRead Event This is the first of the 3 Event Handlers. This one is called as each metadata item is read from the image file. The Event Handler in your application can do anything you want with the data.
IGMetadataItemWrite Event This is the second of the 3 Event Handlers. This one is called as each metadata item is written back into the image-file. The Event Handler in your application can inspect the data, and if IGMetadataItem Object.ReadOnly is False, can change the value.
IGMetadataItemAdd Event This is the third of the 3 Event Handlers. This one is called after the existing metadata (if any) has been written to the file. Your Event Handler must fill in the IGMetadataItem Object. If you wish to create multiple metadata items, then set the IsLastItem to False and return to ImageGear. ImageGear will store that metadata item and raise the Event again. When your Event Handler fills in the IGMetadataItem Object for the last time, then set IsLastItem to False, and the Event won't be raised again.

 

 


©2016. Accusoft Corporation. All Rights Reserved.

Send Feedback