Class ImageUtil

java.lang.Object
com.kheops.util.ImageUtil

public class ImageUtil extends Object
  • Constructor Details

    • ImageUtil

      public ImageUtil()
  • Method Details

    • getMetadataTags

      public static List<ImageMetadataTag> getMetadataTags(InputStream stream) throws Exception
      Throws:
      Exception
    • getMetadataTags

      public static List<ImageMetadataTag> getMetadataTags(File file) throws Exception
      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

      public static BufferedImage applyImageRotation(ByteArrayInputStream bais)
    • rotate

      public static BufferedImage rotate(BufferedImage bufImage, double degrees)
    • flip

      public static BufferedImage flip(BufferedImage bufImage)
    • 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

      public static BufferedImage trim(BufferedImage image)