How to access a JPEG's EXIF tag


Summary Some JPEG images have Exchangeable Image File (EXIF) format tags stored in the header. The code example in this article shows how to access the EXIF information.

Accessing a JPEG's EXIF tag

Use the following code example 
[Java]
static void JPEG_EXIFtag(IRasterDataset exifDataset)throws Exception{
    //exifDataset represents the raster dataset opened from a JPEG file that has an EXIF tag.
    IDataset dataset = new IDatasetProxy(exifDataset);
    //Get the EXIF tags and the associated values.
    IPropertySet propertySet = dataset.getPropertySet();
    Object[] tag_names = new Object[1];
    Object[] tag_values = new Object[1];
    propertySet.getAllProperties(tag_names, tag_values);
    String[] stringNames = (String[])tag_names[0];
    Object[] stringValues = (Object[])tag_values[0];
    for (int i = 0; i <= stringNames.length - 1; i++){
        System.out.print(stringNames[i] + ":");
        System.out.println(stringValues[i]);
    }
}






Development licensing Deployment licensing
ArcInfo ArcInfo
ArcEditor ArcEditor
ArcView ArcView
Engine Developer Kit Engine Runtime