Back to Fresco

JfifUtil

docs/javadoc/reference/com/facebook/imageutils/JfifUtil.html

3.6.014.1 KB
Original Source

Fresco

|

|

Packages | Classes

Classes

Packages | Classes

Summary: Constants | Methods | Inherited Methods | [Expand All]

public class

JfifUtil

extends Object

| java.lang.Object | | ↳ | com.facebook.imageutils.JfifUtil |

Class Overview

Util for obtaining information from JPEG file.

Summary

Constants
int
int
int
int
int
int
int
int
int
int
int
Public Methods
static int
Determines auto-rotate angle based on orientation information.
static int
Gets orientation information from jpeg byte array.
static int
Get orientation information from jpeg input stream.
static boolean
Reads the content of the input stream until specified marker is found.

| [Expand] Inherited Methods | | --- | | From class java.lang.Object

| Object | clone() | | boolean | equals(Object arg0) | | void | finalize() | | final Class<?> | getClass() | | int | hashCode() | | final void | notify() | | final void | notifyAll() | | String | toString() | | final void | wait(long arg0, int arg1) | | final void | wait(long arg0) | | final void | wait() |

|

Constants

public static final int APP1_EXIF_MAGIC

Constant Value: 1165519206 (0x45786966)

public static final int MARKER_APP1

Constant Value: 225 (0x000000e1)

public static final int MARKER_EOI

Constant Value: 217 (0x000000d9)

public static final int MARKER_ESCAPE_BYTE

Constant Value: 0 (0x00000000)

public static final int MARKER_FIRST_BYTE

Definitions of jpeg markers as well as overall description of jpeg file format can be found here: Recommendation T.81

Constant Value: 255 (0x000000ff)

public static final int MARKER_RST0

Constant Value: 208 (0x000000d0)

public static final int MARKER_RST7

Constant Value: 215 (0x000000d7)

public static final int MARKER_SOFn

Constant Value: 192 (0x000000c0)

public static final int MARKER_SOI

Constant Value: 216 (0x000000d8)

public static final int MARKER_SOS

Constant Value: 218 (0x000000da)

public static final int MARKER_TEM

Constant Value: 1 (0x00000001)

Public Methods

public static int getAutoRotateAngleFromOrientation(int orientation)

Determines auto-rotate angle based on orientation information.

Parameters

| orientation | orientation information, one of {1, 3, 6, 8}. |

Returns
  • orientation: 1/3/6/8 -> 0/180/90/270.

public static int getOrientation(byte[] jpeg)

Gets orientation information from jpeg byte array.

Parameters

| jpeg | the input byte array of jpeg image |

Returns
  • orientation: 1/8/3/6. Returns 0 if there is no valid orientation information.

public static int getOrientation(InputStream is)

Get orientation information from jpeg input stream.

Parameters

| is | the input stream of jpeg image |

Returns
  • orientation: 1/8/3/6. Returns {@value android.media.ExifInterface#ORIENTATION_UNDEFINED} if there is no valid orientation information.

public static boolean moveToMarker(InputStream is, int 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

| is | the input stream to read bytes from | | markerToFind | the marker we are looking for |

Returns
  • boolean: whether or not we found the expected marker from input stream.
Throws

| IOException | |

+Generated by Doclava. +