Package com.itextpdf.io.image
Class JpegImageHelper
- java.lang.Object
-
- com.itextpdf.io.image.JpegImageHelper
-
class JpegImageHelper extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private static byte[]
JFIF_ID
sequence that is used in all Jpeg filesprivate static org.slf4j.Logger
LOGGER
private static int
M_APP0
Marker valueprivate static int
M_APP2
Marker valueprivate static int
M_APPD
Marker value for Photoshop IRBprivate static int
M_APPE
Marker valueprivate static int
NOPARAM_MARKER
This is a type of marker.private static int[]
NOPARAM_MARKERS
Jpeg markers without additional parameters.private static int
NOT_A_MARKER
This is a type of marker.private static byte[]
PS_8BIM_RESO
sequence preceding Photoshop resolution dataprivate static int
UNSUPPORTED_MARKER
This is a type of marker.private static int[]
UNSUPPORTED_MARKERS
Unsupported Jpeg markers.private static int
VALID_MARKER
This is a type of marker.private static int[]
VALID_MARKERS
Acceptable Jpeg markers.
-
Constructor Summary
Constructors Constructor Description JpegImageHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description (package private) static void
attemptToSetIccProfileToImage(byte[][] icc, ImageData image)
private static int
getShort(java.io.InputStream jpegStream)
Reads a short from theInputStream
.private static int
marker(int marker)
Returns a type of marker.static void
processImage(ImageData image)
Process the passed Image data as a JPEG image.private static void
processParameters(java.io.InputStream jpegStream, java.lang.String errorID, ImageData image)
This method checks if the image is a valid JPEG and processes some parameters.private static void
updateAttributes(ImageData image)
-
-
-
Field Detail
-
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:
- Constant Field Values
-
VALID_MARKER
private static final int VALID_MARKER
This is a type of marker.- See Also:
- Constant Field Values
-
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:
- Constant Field Values
-
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:
- Constant Field Values
-
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:
- Constant Field Values
-
M_APP2
private static final int M_APP2
Marker value- See Also:
- Constant Field Values
-
M_APPE
private static final int M_APPE
Marker value- See Also:
- Constant Field Values
-
M_APPD
private static final int M_APPD
Marker value for Photoshop IRB- See Also:
- Constant Field Values
-
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
-
-
Method Detail
-
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(java.io.InputStream jpegStream, java.lang.String errorID, ImageData image) throws java.io.IOException
This method checks if the image is a valid JPEG and processes some parameters.- Throws:
IOException
java.io.IOException
-
getShort
private static int getShort(java.io.InputStream jpegStream) throws java.io.IOException
Reads a short from theInputStream
.- Parameters:
jpegStream
- theInputStream
- Returns:
- an int
- Throws:
java.io.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
-
-