use of org.apache.sanselan.formats.tiff.TiffImageMetadata in project iNaturalistAndroid by inaturalist.
the class ImageUtils method getSanselanOutputSet.
private static TiffOutputSet getSanselanOutputSet(File jpegImageFile, int defaultByteOrder) throws IOException, ImageReadException, ImageWriteException {
TiffImageMetadata exif = null;
TiffOutputSet outputSet = null;
IImageMetadata metadata = Sanselan.getMetadata(jpegImageFile);
JpegImageMetadata jpegMetadata = (JpegImageMetadata) metadata;
if (jpegMetadata != null) {
exif = jpegMetadata.getExif();
if (exif != null) {
outputSet = exif.getOutputSet();
}
}
// keep all other existing tags
if (outputSet == null)
outputSet = new TiffOutputSet(exif == null ? defaultByteOrder : exif.contents.header.byteOrder);
return outputSet;
}
use of org.apache.sanselan.formats.tiff.TiffImageMetadata in project iNaturalistAndroid by inaturalist.
the class ImageUtils method getSanselanOutputSet.
private static TiffOutputSet getSanselanOutputSet(InputStream stream, int defaultByteOrder) throws IOException, ImageReadException, ImageWriteException {
TiffImageMetadata exif = null;
TiffOutputSet outputSet = null;
IImageMetadata metadata = Sanselan.getMetadata(stream, null);
JpegImageMetadata jpegMetadata = (JpegImageMetadata) metadata;
if (jpegMetadata != null) {
exif = jpegMetadata.getExif();
if (exif != null) {
outputSet = exif.getOutputSet();
}
}
// keep all other existing tags
if (outputSet == null)
outputSet = new TiffOutputSet(exif == null ? defaultByteOrder : exif.contents.header.byteOrder);
return outputSet;
}
Aggregations