Package com.kheops.util
Class ImageUtil
java.lang.Object
com.kheops.util.ImageUtil
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic BufferedImage
static BufferedImage
flip
(BufferedImage bufImage) static BufferedImage
getFasterScaledInstance
(BufferedImage img, int targetWidth, int targetHeight, Object hint, boolean progressiveBilinear) static ImageMetadataTag
getImageMetadataTag
(String directoryName, int tagType, List<ImageMetadataTag> imageMetadataTags) static ImageMetadataTag
getImageMetadataTag
(String directoryName, String tagName, List<ImageMetadataTag> imageMetadataTags) static ImageMetadataTag[]
getImageMetadataTags
(int tagType, List<ImageMetadataTag> imageMetadataTags) static ImageMetadataTag[]
getImageMetadataTags
(String tagName, List<ImageMetadataTag> imageMetadataTags) static List
<ImageMetadataTag> getMetadataTags
(File file) static List
<ImageMetadataTag> getMetadataTags
(InputStream stream) static int[]
getResizedDimensions
(int originalWidth, int originalHeight, int targetWidth, int targetHeight) Calculates a cross product from the original dimensions.static BufferedImage
rotate
(BufferedImage bufImage, double degrees) static BufferedImage
trim
(BufferedImage image)
-
Constructor Details
-
ImageUtil
public ImageUtil()
-
-
Method Details
-
getMetadataTags
- Throws:
Exception
-
getMetadataTags
- Throws:
Exception
-
getImageMetadataTags
public static ImageMetadataTag[] getImageMetadataTags(int tagType, List<ImageMetadataTag> imageMetadataTags) -
getImageMetadataTag
public static ImageMetadataTag getImageMetadataTag(String directoryName, int tagType, List<ImageMetadataTag> imageMetadataTags) -
getImageMetadataTags
public static ImageMetadataTag[] getImageMetadataTags(String tagName, List<ImageMetadataTag> imageMetadataTags) -
getImageMetadataTag
public static ImageMetadataTag getImageMetadataTag(String directoryName, String tagName, List<ImageMetadataTag> imageMetadataTags) -
applyImageRotation
-
rotate
-
flip
-
getFasterScaledInstance
public static BufferedImage getFasterScaledInstance(BufferedImage img, int targetWidth, int targetHeight, Object hint, boolean progressiveBilinear) -
getResizedDimensions
public static int[] getResizedDimensions(int originalWidth, int originalHeight, int targetWidth, int targetHeight) Calculates a cross product from the original dimensions. Returns proportionally resized dimensions.- Parameters:
originalWidth
- The original document's width.originalHeight
- The original document's height.targetWidth
- If bigger than 0, proportionally resize the image to match the width provided (in pixels).targetHeight
- If bigger than 0, proportionally resize the image to match the height provided (in pixels).- Returns:
- The proportionally resized image dimensions as an int[2]. The width being stored at index 0. The height being stored at index 1. If both height and width passed as argument are invalid input: '<'= 0, return the original image dimensions.
-
trim
-