Class XImageUtils


  • public final class XImageUtils
    extends Object
    Utility class for image operations.
    Since:
    8.3.0
    Author:
    XIMA MEDIA GmbH
    • Method Detail

      • findImageSize

        public static ImageSize findImageSize​(Path imageData)
                                       throws IOException
        Finds the size of an image file. Determines the format from the given file name via the extension (.jpg, .png, etc.).
        Parameters:
        imageData - File with the image data.
        Returns:
        Size of the image.
        Throws:
        IOException - If the image size could not be determined.
      • findImageSize

        public static ImageSize findImageSize​(Path imageData,
                                              String fileName)
                                       throws IOException
        Finds the size of an image file. Determines the format from the given file name via the extension (.jpg, .png, etc.).
        Parameters:
        imageData - File with the image data.
        fileName - Name of the file. Can also be just an extension, such as "png".
        Returns:
        Size of the image.
        Throws:
        IOException - If the image size could not be determined.
      • findImageSize

        public static ImageSize findImageSize​(InputStream imageData,
                                              String fileName)
                                       throws IOException
        Finds the size of an image file. Determines the format from the given file name via the extension (.jpg, .png, etc.).
        Parameters:
        imageData - File with the image data.
        fileName - Name of the file. Can also be just an extension, such as "png".
        Returns:
        Size of the image.
        Throws:
        IOException - If the image size could not be determined.