Class AvifDecoder

java.lang.Object
com.idrsolutions.image.JDeliImage
com.idrsolutions.image.avif.AvifDecoder
All Implemented Interfaces:
com.idrsolutions.image.Decoder

public class AvifDecoder extends com.idrsolutions.image.JDeliImage implements com.idrsolutions.image.Decoder
Class reads AVIF images as BufferedImage. Make no assumptions about the type of BufferedImage returned (may change).

Example:


 AvifDecoder decoder = new AvifDecoder();
 BufferedImage decodedImage = decoder.read(avifFile);
 
  • Field Summary

    Fields inherited from class com.idrsolutions.image.JDeliImage

    bb
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    isReadable(byte[] data)
    Checks whether the avif image data can be decoded, by validating its structure without decoding the pixels
    boolean
    isReadable(File imageFile)
    Checks whether the avif image file can be decoded, by validating its structure without decoding the pixels
    read(byte[] data)
     
    read(File imageFile)
     
    readDimension(byte[] data)
    Decodes and returns the width and height of avif image
    Decodes and returns the width and height of avif image
    readExif(byte[] data)
    Decodes and returns the Exif data as IFD format if there is an IFDdata otherwise returns null
    readExif(File file)
    Decodes and returns the Exif data as IFD format if there is an IFDdata otherwise returns null
    void
    readImageSpecificMetaData(byte[] bytes, Metadata metadata)
    Read Avif specific metadata such as IFD
    void
    Read Avif specific metadata such as IFD

    Methods inherited from class com.idrsolutions.image.JDeliImage

    optimiseImage

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.idrsolutions.image.Decoder

    getImageCount, getImageCount, readEmbeddedThumbnail, readEmbeddedThumbnail, readImageAt, readImageAt, setMetadata
  • Constructor Details

    • AvifDecoder

      public AvifDecoder()
  • Method Details

    • read

      public BufferedImage read(byte[] data) throws Exception
      Specified by:
      read in interface com.idrsolutions.image.Decoder
      Parameters:
      data - source image to read
      Returns:
      image contained in raw data
      Throws:
      Exception - if problem reading image
    • read

      public BufferedImage read(File imageFile) throws Exception
      Specified by:
      read in interface com.idrsolutions.image.Decoder
      Parameters:
      imageFile - source image to read
      Returns:
      image read from the file
      Throws:
      Exception - if problem reading image
    • readDimension

      public Rectangle readDimension(File file) throws Exception
      Decodes and returns the width and height of avif image
      Specified by:
      readDimension in interface com.idrsolutions.image.Decoder
      Parameters:
      file - image image contained in raw data if present
      Returns:
      width and height of image
      Throws:
      Exception - if problem reading image
    • readDimension

      public Rectangle readDimension(byte[] data) throws Exception
      Decodes and returns the width and height of avif image
      Specified by:
      readDimension in interface com.idrsolutions.image.Decoder
      Parameters:
      data - image image contained in raw data if present
      Returns:
      Rectangle width and height of image
      Throws:
      Exception - if problem reading image
    • isReadable

      public boolean isReadable(byte[] data) throws Exception
      Checks whether the avif image data can be decoded, by validating its structure without decoding the pixels
      Specified by:
      isReadable in interface com.idrsolutions.image.Decoder
      Parameters:
      data - avif image data
      Returns:
      true if the image can be decoded
      Throws:
      Exception - if problem reading image
    • isReadable

      public boolean isReadable(File imageFile) throws Exception
      Checks whether the avif image file can be decoded, by validating its structure without decoding the pixels
      Specified by:
      isReadable in interface com.idrsolutions.image.Decoder
      Parameters:
      imageFile - avif image file
      Returns:
      true if the image can be decoded
      Throws:
      Exception - if problem reading image
    • readExif

      public Exif readExif(File file) throws Exception
      Decodes and returns the Exif data as IFD format if there is an IFDdata otherwise returns null
      Parameters:
      file - image image contained in raw data if present
      Returns:
      BufferedImage thumbnail image
      Throws:
      Exception - if problem reading image
    • readExif

      public Exif readExif(byte[] data) throws Exception
      Decodes and returns the Exif data as IFD format if there is an IFDdata otherwise returns null
      Parameters:
      data - image image contained in raw data if present
      Returns:
      BufferedImage thumbnail image
      Throws:
      Exception - if problem reading image
    • readImageSpecificMetaData

      public void readImageSpecificMetaData(File file, Metadata metadata) throws Exception
      Read Avif specific metadata such as IFD
      Specified by:
      readImageSpecificMetaData in interface com.idrsolutions.image.Decoder
      Parameters:
      file - file to read from
      metadata - image metadata object to hold all metadata
      Throws:
      Exception
    • readImageSpecificMetaData

      public void readImageSpecificMetaData(byte[] bytes, Metadata metadata) throws Exception
      Read Avif specific metadata such as IFD
      Specified by:
      readImageSpecificMetaData in interface com.idrsolutions.image.Decoder
      Parameters:
      bytes - byte array to read data from
      metadata - image metadata object to hold all metadata
      Throws:
      Exception