IExif
Leave feedback
On this page
public interface IExif
Defines base operations intended to work with EXIF metadata.
Learn more
This code sample demonstrates how to extract basic EXIF metadata properties.
try (Metadata metadata = new Metadata(Constants.TiffWithExif)) { IExif root = (IExif) metadata.getRootPackage(); if (root.getExifPackage() != null) { System.out.println(root.getExifPackage().getArtist()); System.out.println(root.getExifPackage().getCopyright()); System.out.println(root.getExifPackage().getImageDescription()); System.out.println(root.getExifPackage().getMake()); System.out.println(root.getExifPackage().getModel()); System.out.println(root.getExifPackage().getSoftware()); System.out.println(root.getExifPackage().getImageWidth()); System.out.println(root.getExifPackage().getImageLength()); // … System.out.println(root.getExifPackage().getExifIfdPackage().getBodySerialNumber()); System.out.println(root.getExifPackage().getExifIfdPackage().getCameraOwnerName()); System.out.println(root.getExifPackage().getExifIfdPackage().getUserComment()); // … System.out.println(root.getExifPackage().getGpsPackage().getAltitude()); System.out.println(root.getExifPackage().getGpsPackage().getLatitudeRef()); System.out.println(root.getExifPackage().getGpsPackage().getLongitudeRef()); // … } }
| Method | Description |
|---|---|
| getExifPackage() | Gets the EXIF metadata package associated with the file. |
| setExifPackage(ExifPackage value) | Sets the EXIF metadata package associated with the file. |
public abstract ExifPackage getExifPackage()
Gets the EXIF metadata package associated with the file.
Returns: ExifPackage - The EXIF metadata package associated with the file.
public abstract void setExifPackage(ExifPackage value)
Sets the EXIF metadata package associated with the file.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| value | ExifPackage | The EXIF metadata package associated with the file. |
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.