Gallery Server Pro extracts several well-known properties from images such as width, height, camera maker, etc. However, there are
hundreds of potential properties to choose from, and you may want to view some that are not currently being extracted. Here are instructions for modifying the source code to extract additional metadata items or change how current ones are extracted.
The metadata extraction is done in the file/class MediaObjectMetaDataExtractor.cs in the project TIS.GSP.Business. Metadata are extracted when an object is first added to the gallery and when a synchronization is performed when the "Re-import metadata" option is selected. Metadata are extracted in two basic steps:
1. Raw metadata are extracted from the image and stored in an internal dictionary named _rawMetadata.
2. A small subset of the raw metadata is extracted and formatted into user-friendly phrases, such as "3008 px" for width. This subset is returned by the GetGalleryObjectMetadataItemCollection method and assigned to a property on the Image class, where it is ultimately stored in the gs_MediaObjectMetadata table in the database.
Since all possible metadata will be extracted into the first step, all you have to do is format the raw data into a user-friendly format. The dictionary where the raw data is stored (_rawMetadata) is keyed by the enum RawMetadataItemName.
To convert the raw metadata into formatted values displayed in the web page, you need to add code to the function AddExifMetadata to pull out the raw data from _rawMetadata, format it, and add it to IGalleryObjectMetadataItemCollection parameter passed into the function. This will involve adding at least one item to an enumeration named FormattedMetadataItemName. For example, if you are extracting the altitude from the raw property GpsAltitude, you might add an enum item 'Altitude'.
Once you add the formatted value to the collection, you are done. It should automatically be persisted to the database and displayed in the metadata window.
If you discover that you want to display a metadata item that is not extracted into the _rawMetadata dictionary, boy I don't know what to tell you. It may not be possible with the .NET Framework, but you might have success if you reach into the Win32 classes.
Note: In addition to pulling data directly from the Exif data using the .NET 2.0 technique, if .NET 3.0 or 3.5 is installed, the MediaObjectMetaDataExtractor class gives priority to any metadata discovered via the new WPF classes. This happens in the class WpfMetadataExtractor in the project TIS.GSP.Business.Wpf. This code is invoked by the AddWpfBitmapMetadata function. If you are modifying one of the metadata items that are extracted from this function, you must edit the WpfMetadataExtractor class instead.
Hope this helps,
Roger Martin
Creator and Lead Developer of Gallery Server Pro