-
public class JfifUtilUtil for obtaining information from JPEG file.
-
-
Field Summary
Fields Modifier and Type Field Description private final IntegerMARKER_FIRST_BYTEprivate final IntegerMARKER_ESCAPE_BYTEprivate final IntegerMARKER_SOIprivate final IntegerMARKER_TEMprivate final IntegerMARKER_EOIprivate final IntegerMARKER_SOSprivate final IntegerMARKER_APP1private final IntegerMARKER_SOFnprivate final IntegerMARKER_RST0private final IntegerMARKER_RST7private final IntegerAPP1_EXIF_MAGICpublic final static JfifUtilINSTANCE
-
Method Summary
Modifier and Type Method Description final static IntegergetAutoRotateAngleFromOrientation(Integer orientation)Determines auto-rotate angle based on orientation information. final static IntegergetOrientation(ByteArray jpeg)Gets orientation information from jpeg byte array. final static IntegergetOrientation(InputStream inputStream)Get orientation information from jpeg input stream. final static BooleanmoveToMarker(InputStream inputStream, Integer markerToFind)Reads the content of the input stream until specified marker is found. final IntegergetMARKER_FIRST_BYTE()Definitions of jpeg markers as well as overall description of jpeg file format can be found here: Recommendation T.81 final IntegergetMARKER_ESCAPE_BYTE()final IntegergetMARKER_SOI()final IntegergetMARKER_TEM()final IntegergetMARKER_EOI()final IntegergetMARKER_SOS()final IntegergetMARKER_APP1()final IntegergetMARKER_SOFn()final IntegergetMARKER_RST0()final IntegergetMARKER_RST7()final IntegergetAPP1_EXIF_MAGIC()-
-
Method Detail
-
getAutoRotateAngleFromOrientation
final static Integer getAutoRotateAngleFromOrientation(Integer orientation)
Determines auto-rotate angle based on orientation information.
- Parameters:
orientation- orientation information, one of {1, 3, 6, 8}.
-
getOrientation
final static Integer getOrientation(ByteArray jpeg)
Gets orientation information from jpeg byte array.
- Parameters:
jpeg- the input byte array of jpeg image
-
getOrientation
final static Integer getOrientation(InputStream inputStream)
Get orientation information from jpeg input stream.
- Parameters:
inputStream- the input stream of jpeg image
-
moveToMarker
final static Boolean moveToMarker(InputStream inputStream, Integer markerToFind)
Reads the content of the input stream until specified marker is found. Marker will be consumed and the input stream will be positioned after the specified marker.
- Parameters:
inputStream- the input stream to read bytes frommarkerToFind- the marker we are looking for
-
getMARKER_FIRST_BYTE
final Integer getMARKER_FIRST_BYTE()
Definitions of jpeg markers as well as overall description of jpeg file format can be found here: Recommendation T.81
-
getMARKER_ESCAPE_BYTE
final Integer getMARKER_ESCAPE_BYTE()
-
getMARKER_SOI
final Integer getMARKER_SOI()
-
getMARKER_TEM
final Integer getMARKER_TEM()
-
getMARKER_EOI
final Integer getMARKER_EOI()
-
getMARKER_SOS
final Integer getMARKER_SOS()
-
getMARKER_APP1
final Integer getMARKER_APP1()
-
getMARKER_SOFn
final Integer getMARKER_SOFn()
-
getMARKER_RST0
final Integer getMARKER_RST0()
-
getMARKER_RST7
final Integer getMARKER_RST7()
-
getAPP1_EXIF_MAGIC
final Integer getAPP1_EXIF_MAGIC()
-
-
-
-