Sometimes it’s not obvious what a particular metadata property is supposed to mean. A good example is a numeric flag or enumeration. For instance, here is the description of the EXIF ExposureProgram tag taken from the official EXIF specification:
Note
The class of the program used by the camera to set exposure when the picture is taken. The tag values are as follows.
0 = Not defined
1 = Manual
2 = Normal program
3 = Aperture priority
4 = Shutter priority
5 = Creative program
6 = Action program
7 = Portrait mode
8 = Landscape mode
As you can see, all modes are represented by numeric values. If you are not familiar with the specification, converting these bare numbers to something meaningful is hard. This is where interpreted values come in — they provide a user-friendly description of the original property value.
To get a full list of properties that have interpreted values for a particular file, use the example below. The original value is available through prop.value.raw_value and the human-readable one through prop.interpreted_value.raw_value.
fromgroupdocs.metadataimportMetadatadefworking_with_interpreted_values():withMetadata("input.jpg")asmetadata:# Keep only properties that expose a human-readable interpreted valueproperties=metadata.find_properties(lambdap:p.interpreted_valueisnotNone)forpropinproperties:print(prop.name)print(prop.value.raw_value)# original (raw) valueprint(prop.interpreted_value.raw_value)# friendly interpretationprint()if__name__=="__main__":working_with_interpreted_values()
input.jpg is the sample file used in this example. Click here to download it.