Class Jpeg

    • Field Detail

      • NOT_A_MARKER

        public static final int NOT_A_MARKER
        This is a type of marker.
        See Also:
        Constant Field Values
      • VALID_MARKER

        public static final int VALID_MARKER
        This is a type of marker.
        See Also:
        Constant Field Values
      • VALID_MARKERS

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

        public static final int UNSUPPORTED_MARKER
        This is a type of marker.
        See Also:
        Constant Field Values
      • UNSUPPORTED_MARKERS

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

        public static final int NOPARAM_MARKER
        This is a type of marker.
        See Also:
        Constant Field Values
      • NOPARAM_MARKERS

        public static final int[] NOPARAM_MARKERS
        Jpeg markers without additional parameters.
      • JFIF_ID

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

        public static final byte[] PS_8BIM_RESO
        sequence preceding Photoshop resolution data
      • icc

        private byte[][] icc
    • Constructor Detail

      • Jpeg

        Jpeg​(Image image)
      • Jpeg

        public Jpeg​(java.net.URL url)
             throws BadElementException,
                    java.io.IOException
        Constructs a Jpeg-object, using an url.
        Parameters:
        url - the URL where the image can be found
        Throws:
        BadElementException
        java.io.IOException
      • Jpeg

        public Jpeg​(byte[] img)
             throws BadElementException,
                    java.io.IOException
        Constructs a Jpeg-object from memory.
        Parameters:
        img - the memory image
        Throws:
        BadElementException
        java.io.IOException
      • Jpeg

        public Jpeg​(byte[] img,
                    float width,
                    float height)
             throws BadElementException,
                    java.io.IOException
        Constructs a Jpeg-object from memory.
        Parameters:
        img - the memory image.
        width - the width you want the image to have
        height - the height you want the image to have
        Throws:
        BadElementException
        java.io.IOException
    • Method Detail

      • getShort

        private static final int getShort​(java.io.InputStream is)
                                   throws java.io.IOException
        Reads a short from the InputStream.
        Parameters:
        is - the InputStream
        Returns:
        an int
        Throws:
        java.io.IOException
      • marker

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

        private void processParameters()
                                throws BadElementException,
                                       java.io.IOException
        This method checks if the image is a valid JPEG and processes some parameters.
        Throws:
        BadElementException
        java.io.IOException