Class JpegImageHelper
java.lang.Object
com.itextpdf.io.image.JpegImageHelper
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final byte[]sequence that is used in all Jpeg filesprivate static final org.slf4j.Loggerprivate static final intMarker valueprivate static final intMarker valueprivate static final intMarker value for Photoshop IRBprivate static final intMarker valueprivate static final intThis is a type of marker.private static final int[]Jpeg markers without additional parameters.private static final intThis is a type of marker.private static final byte[]sequence preceding Photoshop resolution dataprivate static final intThis is a type of marker.private static final int[]Unsupported Jpeg markers.private static final intThis is a type of marker.private static final int[]Acceptable Jpeg markers. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static voidattemptToSetIccProfileToImage(byte[][] icc, ImageData image) private static intgetShort(InputStream jpegStream) Reads a short from theInputStream.private static intmarker(int marker) Returns a type of marker.static voidprocessImage(ImageData image) Process the passed Image data as a JPEG image.private static voidprocessParameters(InputStream jpegStream, String errorID, ImageData image) This method checks if the image is a valid JPEG and processes some parameters.private static voidupdateAttributes(ImageData image)
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
NOT_A_MARKER
private static final int NOT_A_MARKERThis is a type of marker.- See Also:
-
VALID_MARKER
private static final int VALID_MARKERThis is a type of marker.- See Also:
-
VALID_MARKERS
private static final int[] VALID_MARKERSAcceptable Jpeg markers. -
UNSUPPORTED_MARKER
private static final int UNSUPPORTED_MARKERThis is a type of marker.- See Also:
-
UNSUPPORTED_MARKERS
private static final int[] UNSUPPORTED_MARKERSUnsupported Jpeg markers. -
NOPARAM_MARKER
private static final int NOPARAM_MARKERThis is a type of marker.- See Also:
-
NOPARAM_MARKERS
private static final int[] NOPARAM_MARKERSJpeg markers without additional parameters. -
M_APP0
private static final int M_APP0Marker value- See Also:
-
M_APP2
private static final int M_APP2Marker value- See Also:
-
M_APPE
private static final int M_APPEMarker value- See Also:
-
M_APPD
private static final int M_APPDMarker value for Photoshop IRB- See Also:
-
JFIF_ID
private static final byte[] JFIF_IDsequence that is used in all Jpeg files -
PS_8BIM_RESO
private static final byte[] PS_8BIM_RESOsequence preceding Photoshop resolution data
-
-
Constructor Details
-
JpegImageHelper
JpegImageHelper()
-
-
Method Details
-
processImage
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
-
updateAttributes
-
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:
IOExceptionIOException
-
getShort
Reads a short from theInputStream.- Parameters:
jpegStream- theInputStream- 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
-