Class ImageUtils
- java.lang.Object
-
- org.openstreetmap.josm.gui.layer.geoimage.ImageUtils
-
public final class ImageUtils extends java.lang.Object
Image utilities- Since:
- 18592
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classImageUtils.NoMetadataReaderWarning
-
Constructor Summary
Constructors Modifier Constructor Description privateImageUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidapplyExif(ImageMetadata image, java.io.InputStream inputStream)Apply exif information from anInputStreamstatic java.awt.image.BufferedImageapplyExifRotation(java.awt.image.BufferedImage img, java.lang.Integer exifOrientation)Rotate an image, if neededprivate static com.drew.metadata.MetadatagetMetadata(java.net.URI uri, java.io.InputStream inputStream)private static <T> voidifNotNull(T value, java.util.function.Consumer<T> setter)static javax.imageio.ImageReadParamwithSubsampling(javax.imageio.ImageReader reader, java.awt.Dimension target)Common subsampling method
-
-
-
Constructor Detail
-
ImageUtils
private ImageUtils()
-
-
Method Detail
-
applyExifRotation
public static java.awt.image.BufferedImage applyExifRotation(java.awt.image.BufferedImage img, java.lang.Integer exifOrientation)
Rotate an image, if needed- Parameters:
img- The image to rotateexifOrientation- The exif orientation- Returns:
- The rotated image or the original
-
withSubsampling
public static javax.imageio.ImageReadParam withSubsampling(javax.imageio.ImageReader reader, java.awt.Dimension target)
Common subsampling method- Parameters:
reader- The image readertarget- The target area- Returns:
- The sampling parameters
-
applyExif
public static void applyExif(ImageMetadata image, java.io.InputStream inputStream)
Apply exif information from anInputStream- Parameters:
image- The image to apply information toinputStream- The input stream to read
-
getMetadata
private static com.drew.metadata.Metadata getMetadata(java.net.URI uri, java.io.InputStream inputStream)
-
ifNotNull
private static <T> void ifNotNull(T value, java.util.function.Consumer<T> setter)
-
-