Skip to content

Commit 54ed73e

Browse files
committed
Release version 0.2.0
1 parent e8f2674 commit 54ed73e

16 files changed

+395
-311
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
<groupId>com.sdklite</groupId>
1212
<artifactId>exif</artifactId>
13-
<version>0.1.0</version>
13+
<version>0.2.0</version>
1414
<packaging>jar</packaging>
1515

1616
<name>${project.artifactId}</name>

src/main/java/com/android/gallery3d/exif/ByteBufferInputStream.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
package com.android.gallery3d.exif;
2-
31
/*
42
* Copyright (C) 2012 The Android Open Source Project
53
*
@@ -16,10 +14,13 @@
1614
* limitations under the License.
1715
*/
1816

17+
package com.android.gallery3d.exif;
18+
1919
import java.io.InputStream;
2020
import java.nio.ByteBuffer;
2121

2222
class ByteBufferInputStream extends InputStream {
23+
2324
private ByteBuffer mBuf;
2425

2526
public ByteBufferInputStream(ByteBuffer buf) {
@@ -39,6 +40,7 @@ public int read(byte[] bytes, int off, int len) {
3940
if (!mBuf.hasRemaining()) {
4041
return -1;
4142
}
43+
4244
len = Math.min(len, mBuf.remaining());
4345
mBuf.get(bytes, off, len);
4446
return len;

src/main/java/com/android/gallery3d/exif/CountedDataInputStream.java

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
package com.android.gallery3d.exif;
2-
31
/*
42
* Copyright (C) 2012 The Android Open Source Project
53
*
@@ -16,6 +14,8 @@
1614
* limitations under the License.
1715
*/
1816

17+
package com.android.gallery3d.exif;
18+
1919
import java.io.EOFException;
2020
import java.io.FilterInputStream;
2121
import java.io.IOException;
@@ -25,9 +25,11 @@
2525
import java.nio.charset.Charset;
2626

2727
class CountedDataInputStream extends FilterInputStream {
28+
2829
private int mCount = 0;
30+
2931
// allocate a byte buffer for a long value;
30-
private final byte[] mByteArray = new byte[8];
32+
private final byte mByteArray[] = new byte[8];
3133
private final ByteBuffer mByteBuffer = ByteBuffer.wrap(mByteArray);
3234

3335
protected CountedDataInputStream(InputStream in) {
@@ -73,7 +75,7 @@ public void skipOrThrow(long length) throws IOException {
7375
public void skipTo(long target) throws IOException {
7476
long cur = mCount;
7577
long diff = target - cur;
76-
assert (diff >= 0);
78+
assert(diff >= 0);
7779
skipOrThrow(diff);
7880
}
7981

@@ -95,7 +97,7 @@ public ByteOrder getByteOrder() {
9597
}
9698

9799
public short readShort() throws IOException {
98-
readOrThrow(mByteArray, 0, 2);
100+
readOrThrow(mByteArray, 0 ,2);
99101
mByteBuffer.rewind();
100102
return mByteBuffer.getShort();
101103
}
@@ -105,7 +107,7 @@ public int readUnsignedShort() throws IOException {
105107
}
106108

107109
public int readInt() throws IOException {
108-
readOrThrow(mByteArray, 0, 4);
110+
readOrThrow(mByteArray, 0 , 4);
109111
mByteBuffer.rewind();
110112
return mByteBuffer.getInt();
111113
}
@@ -115,21 +117,20 @@ public long readUnsignedInt() throws IOException {
115117
}
116118

117119
public long readLong() throws IOException {
118-
readOrThrow(mByteArray, 0, 8);
120+
readOrThrow(mByteArray, 0 , 8);
119121
mByteBuffer.rewind();
120122
return mByteBuffer.getLong();
121123
}
122124

123125
public String readString(int n) throws IOException {
124-
byte[] buf = new byte[n];
126+
byte buf[] = new byte[n];
125127
readOrThrow(buf);
126128
return new String(buf, "UTF8");
127129
}
128130

129131
public String readString(int n, Charset charset) throws IOException {
130-
byte[] buf = new byte[n];
132+
byte buf[] = new byte[n];
131133
readOrThrow(buf);
132134
return new String(buf, charset);
133135
}
134-
}
135-
136+
}

src/main/java/com/android/gallery3d/exif/ExifData.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
package com.android.gallery3d.exif;
2-
31
/*
42
* Copyright (C) 2012 The Android Open Source Project
53
*
@@ -16,6 +14,8 @@
1614
* limitations under the License.
1715
*/
1816

17+
package com.android.gallery3d.exif;
18+
1919
import android.util.Log;
2020

2121
import java.io.UnsupportedEncodingException;
@@ -42,6 +42,7 @@ class ExifData {
4242
private static final byte[] USER_COMMENT_UNICODE = {
4343
0x55, 0x4E, 0x49, 0x43, 0x4F, 0x44, 0x45, 0x00
4444
};
45+
4546
private final IfdData[] mIfdDatas = new IfdData[IfdId.TYPE_IFD_COUNT];
4647
private byte[] mThumbnail;
4748
private ArrayList<byte[]> mStripBytes = new ArrayList<byte[]>();
@@ -224,10 +225,13 @@ protected String getUserComment() {
224225
if (tag.getComponentCount() < 8) {
225226
return null;
226227
}
228+
227229
byte[] buf = new byte[tag.getComponentCount()];
228230
tag.getBytes(buf);
231+
229232
byte[] code = new byte[8];
230233
System.arraycopy(buf, 0, code, 0, 8);
234+
231235
try {
232236
if (Arrays.equals(code, USER_COMMENT_ASCII)) {
233237
return new String(buf, 8, buf.length - 8, "US-ASCII");
@@ -340,4 +344,5 @@ public boolean equals(Object obj) {
340344
}
341345
return false;
342346
}
347+
343348
}

0 commit comments

Comments
 (0)