summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/exif/ExifData.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/gallery3d/exif/ExifData.java')
-rw-r--r--src/com/android/gallery3d/exif/ExifData.java57
1 files changed, 57 insertions, 0 deletions
diff --git a/src/com/android/gallery3d/exif/ExifData.java b/src/com/android/gallery3d/exif/ExifData.java
index 712698ef4..5b0e3d8e4 100644
--- a/src/com/android/gallery3d/exif/ExifData.java
+++ b/src/com/android/gallery3d/exif/ExifData.java
@@ -15,6 +15,9 @@
*/
package com.android.gallery3d.exif;
+
+import java.util.ArrayList;
+
/**
* This class stores the EXIF header in IFDs according to the JPEG specification.
* It is the result produced by {@link ExifReader}.
@@ -23,6 +26,8 @@ package com.android.gallery3d.exif;
*/
public class ExifData {
private final IfdData[] mIfdDatas = new IfdData[IfdId.TYPE_IFD_COUNT];
+ private byte[] mThumbnail;
+ private ArrayList<byte[]> mStripBytes = new ArrayList<byte[]>();
/**
* Gets the IFD data of the specified IFD.
@@ -44,4 +49,56 @@ public class ExifData {
public void addIfdData(IfdData data) {
mIfdDatas[data.getId()] = data;
}
+
+ /**
+ * Gets the compressed thumbnail. Returns null if there is no compressed thumbnail.
+ *
+ * @see #hasCompressedThumbnail()
+ */
+ public byte[] getCompressedThumbnail() {
+ return mThumbnail;
+ }
+
+ /**
+ * Sets the compressed thumbnail.
+ */
+ public void setCompressedThumbnail(byte[] thumbnail) {
+ mThumbnail = thumbnail;
+ }
+
+ /**
+ * Returns true it this header contains a compressed thumbnail.
+ */
+ public boolean hasCompressedThumbnail() {
+ return mThumbnail != null;
+ }
+
+ /**
+ * Adds an uncompressed strip.
+ */
+ public void setStripBytes(int index, byte[] strip) {
+ if (index < mStripBytes.size()) {
+ mStripBytes.set(index, strip);
+ } else {
+ for (int i = mStripBytes.size(); i < index; i++) {
+ mStripBytes.add(null);
+ }
+ mStripBytes.add(strip);
+ }
+ }
+
+ /**
+ * Gets the strip count
+ */
+ public int getStripCount() {
+ return mStripBytes.size();
+ }
+
+ /**
+ * Gets the strip at the specified index.
+ * @exceptions #IndexOutOfBoundException
+ */
+ public byte[] getStrip(int index) {
+ return mStripBytes.get(index);
+ }
} \ No newline at end of file