orientation = directory.getInt(ExifIFD0Directory.TAG_ORIENTATION); } catch (MetadataException me) { logger.warn("Could not get orientation");
public void setAudioSampleSize(Directory directory, int tagType) { try { setAudioSampleSize(directory.getInt(tagType)); } catch (MetadataException e) { // Nothing needs to be done } }
public void setPixelWidth(Directory directory, int tagType) { try { setPixelWidth(directory.getInt(tagType)); } catch (MetadataException e) { // Nothing needs to be done } }
public void setPixelHeight(Directory directory, int tagType) { try { setPixelHeight(directory.getInt(tagType)); } catch (MetadataException e) { // Nothing needs to be done } }
public void setDPIWidth(Directory directory, int tagType, double factor) { try { setDPIWidth(directory.getInt(tagType) * factor); } catch (MetadataException e) { // Nothing needs to be done } }
public void setDPIHeight(Directory directory, int tagType, double factor) { try { setDPIHeight(directory.getInt(tagType) * factor); } catch (MetadataException e) { // Nothing needs to be done } }
public void setOrientation(Directory directory, int tagType) { try { setOrientation(directory.getInt(tagType)); } catch (MetadataException e) { // Nothing needs to be done } }
public void setDPIWidth(Directory directory, int tagType) { try { setDPIWidth(directory.getInt(tagType)); } catch (MetadataException e) { // Nothing needs to be done } }
public void setDPIHeight(Directory directory, int tagType) { try { setDPIHeight(directory.getInt(tagType)); } catch (MetadataException e) { // Nothing needs to be done } }
public void setBitPerPixel(Directory directory, int tagType) { try { setBitPerPixel(directory.getInt(tagType)); } catch (MetadataException e) { // Nothing needs to be done } }
private static int readExifOrientation(Metadata metadata) throws MetadataException { Directory directory = metadata.getFirstDirectoryOfType(ExifIFD0Directory.class); return directory.getInt(ExifIFD0Directory.TAG_ORIENTATION); }
private static int readExifOrientation(Metadata metadata) throws MetadataException { Directory directory = metadata.getFirstDirectoryOfType(ExifIFD0Directory.class); return directory.getInt(ExifIFD0Directory.TAG_ORIENTATION); }
/** * Tries to read the orientation data from the given image {@link Metadata}. Returns <code>null</code> if not * found or if an error occurs. */ @Nullable public static ImageOrientation getOrientation(@Nullable final Metadata metadata) { if (metadata != null) { final Directory exifIfd0Directory = metadata.getDirectory(ExifIFD0Directory.class); if (exifIfd0Directory != null) { try { return findById(exifIfd0Directory.getInt(ExifIFD0Directory.TAG_ORIENTATION)); } catch (Exception e) { LOG.info("ImageOrientation.getOrientation(): Exception while trying to read the orientation data from the EXIF. Ignoring and just returning null"); } } } return null; }
int orientation = directory.getInt(ExifIFD0Directory.TAG_ORIENTATION);
Metadata header; try { ByteArrayInputStream bais= new ByteArrayInputStream(data); ExifReader reader = new ExifReader(bais); header = reader.extract(); Directory dir = header.getDirectory(ExifDirectory.class); if (dir.containsTag(ExifDirectory.TAG_ORIENTATION)) { Log.v(TAG, "tag_orientation exists: " + dir.getInt(ExifDirectory.TAG_ORIENTATION)); } else { Log.v(TAG, "tag_orietation doesn't exist"); } } catch (JpegProcessingException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (MetadataException e) { e.printStackTrace(); }
orientation = directory.getInt(ExifIFD0Directory.TAG_ORIENTATION); } catch (MetadataException me) { System.out.println("Could not get orientation");