Class JpegImageHelper

java.lang.Object
com.itextpdf.io.image.JpegImageHelper

class JpegImageHelper extends Object
  • Field Details

    • LOGGER

      private static final org.slf4j.Logger LOGGER
    • NOT_A_MARKER

      private static final int NOT_A_MARKER
      This is a type of marker.
      See Also:
    • VALID_MARKER

      private static final int VALID_MARKER
      This is a type of marker.
      See Also:
    • VALID_MARKERS

      private static final int[] VALID_MARKERS
      Acceptable Jpeg markers.
    • UNSUPPORTED_MARKER

      private static final int UNSUPPORTED_MARKER
      This is a type of marker.
      See Also:
    • UNSUPPORTED_MARKERS

      private static final int[] UNSUPPORTED_MARKERS
      Unsupported Jpeg markers.
    • NOPARAM_MARKER

      private static final int NOPARAM_MARKER
      This is a type of marker.
      See Also:
    • NOPARAM_MARKERS

      private static final int[] NOPARAM_MARKERS
      Jpeg markers without additional parameters.
    • M_APP0

      private static final int M_APP0
      Marker value
      See Also:
    • M_APP2

      private static final int M_APP2
      Marker value
      See Also:
    • M_APPE

      private static final int M_APPE
      Marker value
      See Also:
    • M_APPD

      private static final int M_APPD
      Marker value for Photoshop IRB
      See Also:
    • JFIF_ID

      private static final byte[] JFIF_ID
      sequence that is used in all Jpeg files
    • PS_8BIM_RESO

      private static final byte[] PS_8BIM_RESO
      sequence preceding Photoshop resolution data
  • Constructor Details

    • JpegImageHelper

      JpegImageHelper()
  • Method Details

    • processImage

      public static void processImage(ImageData image)
      Process the passed Image data as a JPEG image. Image is loaded and all image attributes are initialized and/or updated.
      Parameters:
      image - the image to process as a JPEG image
    • attemptToSetIccProfileToImage

      static void attemptToSetIccProfileToImage(byte[][] icc, ImageData image)
    • updateAttributes

      private static void updateAttributes(ImageData image)
    • processParameters

      private static void processParameters(InputStream jpegStream, String errorID, ImageData image) throws IOException
      This method checks if the image is a valid JPEG and processes some parameters.
      Throws:
      IOException
      IOException
    • getShort

      private static int getShort(InputStream jpegStream) throws IOException
      Reads a short from the InputStream.
      Parameters:
      jpegStream - the InputStream
      Returns:
      an int
      Throws:
      IOException
    • marker

      private static int marker(int marker)
      Returns a type of marker.
      Parameters:
      marker - an int
      Returns:
      a type: VALID_MARKER, UNSUPPORTED_MARKER or NOPARAM_MARKER