public static List<ImageMetadata> scanImageMetadata(String fileName, InputStream imageStream) {
List<ImageMetadata> imageAttributes = new ArrayList<ImageMetadata>();
try {
// get all metadata stored in EXIF format (ie. from JPEG or TIFF).
IImageMetadata metadata = Sanselan.getMetadata(imageStream, fileName);
if (metadata instanceof JpegImageMetadata) {
JpegImageMetadata jpegMetadata = (JpegImageMetadata) metadata;
// Jpeg EXIF metadata is stored in a TIFF-based directory structure
// and is identified with TIFF tags.