2015-04-11 23:52:45 +02:00
|
|
|
|
|
|
|
public class Const
|
|
|
|
{
|
2015-04-13 22:42:16 +02:00
|
|
|
/**
|
|
|
|
* Size of a chunk of data (used to split the ExtendedXMP information into blocks
|
|
|
|
*/
|
2015-04-11 23:52:45 +02:00
|
|
|
public static final int CHUNKSIZE = 65400;
|
2015-04-28 22:47:56 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Strings for JPEGUtils.decorate()
|
|
|
|
*/
|
|
|
|
|
2015-04-11 23:52:45 +02:00
|
|
|
public static final String EXIF = "EXIF";
|
|
|
|
public static final String STANDARDXMP = "StandardXMP";
|
|
|
|
public static final String EXTENDEDXMP = "ExtendedXMP";
|
2015-04-28 22:47:56 +02:00
|
|
|
|
2015-04-13 22:42:16 +02:00
|
|
|
/**
|
|
|
|
* Magical bytes that identify the file as JPG (FF D8) (length: 2)
|
|
|
|
*/
|
|
|
|
public static byte[] markJPG = {(byte) 0xFF, (byte) 0xD8};
|
2015-04-28 22:47:56 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Magical bytes that idetify the file as PNG. (0x89 P N G) (length: 4)
|
|
|
|
*/
|
|
|
|
public static byte[] markPNG = {(byte) 0x89, (byte) 0x50, (byte) 0x4E, (byte) 0x47};
|
|
|
|
|
2015-04-13 22:42:16 +02:00
|
|
|
/**
|
|
|
|
* Marker that defines the beginning of a new block of metadata (FF E1) (length: 2)
|
|
|
|
*/
|
|
|
|
public static byte[] markAPP1 = {(byte) 0xFF, (byte) 0xE1};
|
2015-04-28 22:47:56 +02:00
|
|
|
|
2015-04-13 22:42:16 +02:00
|
|
|
/**
|
|
|
|
* Header of the EXIF block (EXIF\0\0) (length: 6)
|
|
|
|
*/
|
|
|
|
public static byte[] markEXIF = {(byte) 0x45, (byte) 0x78, (byte) 0x69, (byte) 0x66, (byte) 0x00, (byte) 0x00};
|
2015-04-28 22:47:56 +02:00
|
|
|
|
2015-04-13 22:42:16 +02:00
|
|
|
/**
|
|
|
|
* Header of the StandardXMP block (http://ns.adobe.com/xap/1.0/\0) (length: 29)
|
|
|
|
*/
|
|
|
|
public static byte[] markStandardXMP = {
|
2015-04-28 22:47:56 +02:00
|
|
|
(byte) 0x68, (byte) 0x74, (byte) 0x74, (byte) 0x70,
|
|
|
|
(byte) 0x3A, (byte) 0x2F, (byte) 0x2F, (byte) 0x6E, (byte) 0x73,
|
|
|
|
(byte) 0x2E, (byte) 0x61, (byte) 0x64, (byte) 0x6F, (byte) 0x62,
|
|
|
|
(byte) 0x65, (byte) 0x2E, (byte) 0x63, (byte) 0x6F, (byte) 0x6D,
|
|
|
|
(byte) 0x2F, (byte) 0x78, (byte) 0x61, (byte) 0x70, (byte) 0x2F,
|
|
|
|
(byte) 0x31, (byte) 0x2E, (byte) 0x30, (byte) 0x2F, (byte) 0x00};
|
|
|
|
|
2015-04-13 22:42:16 +02:00
|
|
|
/**
|
|
|
|
* Header of the ExtendedXMP block (http://ns.adobe.com/xmp/extension/\0) (length: 35)
|
|
|
|
*/
|
|
|
|
public static byte[] markExtendedXMP = {
|
2015-04-28 22:47:56 +02:00
|
|
|
(byte) 0x68, (byte) 0x74, (byte) 0x74, (byte) 0x70,
|
|
|
|
(byte) 0x3A, (byte) 0x2F, (byte) 0x2F, (byte) 0x6E, (byte) 0x73,
|
|
|
|
(byte) 0x2E, (byte) 0x61, (byte) 0x64, (byte) 0x6F, (byte) 0x62,
|
|
|
|
(byte) 0x65, (byte) 0x2E, (byte) 0x63, (byte) 0x6F, (byte) 0x6D,
|
|
|
|
(byte) 0x2F, (byte) 0x78, (byte) 0x6D, (byte) 0x70, (byte) 0x2F,
|
|
|
|
(byte) 0x65, (byte) 0x78, (byte) 0x74, (byte) 0x65, (byte) 0x6e,
|
|
|
|
(byte) 0x73, (byte) 0x69, (byte) 0x6f, (byte) 0x6e, (byte) 0x2f,
|
|
|
|
(byte) 0x00};
|
|
|
|
|
2015-04-13 22:42:16 +02:00
|
|
|
/** Keys (following scheme: key="value") */
|
2015-04-28 22:47:56 +02:00
|
|
|
|
2015-04-13 22:42:16 +02:00
|
|
|
/**
|
|
|
|
* Key for the MD5 digest of the full ExtendedXMP block content (without headers etc.)
|
|
|
|
* (xmpNote:HasExtendedXMP) (length: 22)
|
|
|
|
*/
|
|
|
|
public static byte[] keyHasExtendedXMP = {
|
2015-04-28 22:47:56 +02:00
|
|
|
(byte) 0x78, (byte) 0x6d, (byte) 0x70, (byte) 0x4e, (byte) 0x6f,
|
|
|
|
(byte) 0x74, (byte) 0x65, (byte) 0x3a, (byte) 0x48, (byte) 0x61,
|
|
|
|
(byte) 0x73, (byte) 0x45, (byte) 0x78, (byte) 0x74, (byte) 0x65,
|
|
|
|
(byte) 0x6e, (byte) 0x64, (byte) 0x65, (byte) 0x64, (byte) 0x58,
|
|
|
|
(byte) 0x4d, (byte) 0x50
|
2015-04-11 23:52:45 +02:00
|
|
|
};
|
2015-04-28 22:47:56 +02:00
|
|
|
|
2015-04-13 22:42:16 +02:00
|
|
|
/**
|
|
|
|
* Key for the Base64 encoded png image containing the depth information
|
|
|
|
* (GDepth:Data) (length: 11)
|
|
|
|
*/
|
|
|
|
public static byte[] keyGDepthData = {
|
2015-04-28 22:47:56 +02:00
|
|
|
(byte) 0x47, (byte) 0x44, (byte) 0x65, (byte) 0x70, (byte) 0x74,
|
|
|
|
(byte) 0x68, (byte) 0x3a, (byte) 0x44, (byte) 0x61, (byte) 0x74,
|
|
|
|
(byte) 0x61
|
|
|
|
};
|
|
|
|
|
2015-04-13 22:42:16 +02:00
|
|
|
/**
|
|
|
|
* Key for the Base64 encoded unblurred jpg source image (Google camera will combine this with the depth information to render the blurred image)
|
|
|
|
* (GImage:Data) (length: 11)
|
|
|
|
*/
|
|
|
|
public static byte[] keyGImageData = {
|
2015-04-28 22:47:56 +02:00
|
|
|
(byte) 0x47, (byte) 0x49, (byte) 0x6d, (byte) 0x61, (byte) 0x67,
|
|
|
|
(byte) 0x65, (byte) 0x3a, (byte) 0x44, (byte) 0x61, (byte) 0x74,
|
|
|
|
(byte) 0x61
|
|
|
|
};
|
2015-04-11 23:52:45 +02:00
|
|
|
}
|