Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
halo
packages_apps_Gallery2
Commits
07d72dd5
Commit
07d72dd5
authored
12 years ago
by
Earl Ou
Browse files
Options
Download
Email Patches
Plain Diff
Use hex to represent unknown type and byte type for ExifParser debugging
Change-Id: I1d63698a34cc2c582e3c9c1a117231489ea9e3a2
parent
fa0639a3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
5 deletions
+10
-5
tests/res/xml/galaxy_nexus.xml
tests/res/xml/galaxy_nexus.xml
+2
-2
tests/src/com/android/gallery3d/exif/ExifParserTest.java
tests/src/com/android/gallery3d/exif/ExifParserTest.java
+8
-3
No files found.
tests/res/xml/galaxy_nexus.xml
View file @
07d72dd5
...
...
@@ -14,7 +14,7 @@
<tag
id=
"0x829D"
name=
"FNumber"
>
26/10
</tag>
<tag
id=
"0x8822"
name=
"ExposureProgram"
>
3
</tag>
<tag
id=
"0x8827"
name=
"IsoSpeedRatings"
>
100
</tag>
<tag
id=
"0x9000"
name=
"ExifVersion"
>
48 50 50 48
</tag>
<tag
id=
"0x9000"
name=
"ExifVersion"
>
30 32 32 30
</tag>
<tag
id=
"0x9003"
name=
"DateTimeTimeOriginal"
>
2012:07:30 16:28:42
</tag>
<tag
id=
"0x9004"
name=
"DateTimeTimeDigitized"
>
2012:07:30 16:28:42
</tag>
<tag
id=
"0x9201"
name=
"ShutterSpeed"
>
50/10
</tag>
...
...
@@ -25,7 +25,7 @@
<tag
id=
"0x9207"
name=
"MeteringMode"
>
2
</tag>
<tag
id=
"0x9209"
name=
"Flash"
>
0
</tag>
<tag
id=
"0x920A"
name=
"FocalLength"
>
343/100
</tag>
<tag
id=
"0x9286"
name=
"UserComment"
>
0
0 0
73 73 67 83 65 85 115 101 114 32 99 111 109 109 101 110 116 115
0
</tag>
<tag
id=
"0x9286"
name=
"UserComment"
>
0
0 0
0 0
0
49 49 43 53 41 55 73 65 72 20 63 6f 6d 6d 65 6e 74 73 0
0
</tag>
<tag
id=
"0xA001"
name=
"ColoSpace"
>
1
</tag>
<tag
id=
"0xA002"
name=
"PixelXDimension"
>
2560
</tag>
<tag
id=
"0xA003"
name=
"PixelYDimension"
>
1920
</tag>
...
...
This diff is collapsed.
Click to expand it.
tests/src/com/android/gallery3d/exif/ExifParserTest.java
View file @
07d72dd5
...
...
@@ -230,11 +230,16 @@ public class ExifParserTest extends InstrumentationTestCase {
parser
.
read
(
buf
);
for
(
int
i
=
0
;
i
<
tag
.
getComponentCount
();
i
++)
{
if
(
i
!=
0
)
sbuilder
.
append
(
" "
);
sbuilder
.
append
(
buf
[
i
]);
sbuilder
.
append
(
String
.
format
(
"%02x"
,
buf
[
i
])
)
;
}
break
;
case
ExifTag
.
TYPE_ASCII
:
sbuilder
.
append
(
parser
.
readString
(
tag
.
getComponentCount
()));
buf
=
new
byte
[
tag
.
getComponentCount
()];
parser
.
read
(
buf
);
int
length
=
0
;
while
(
buf
[
length
]
!=
0
&&
length
<
buf
.
length
)
length
++;
// trim the string to fit the answer from xml
sbuilder
.
append
(
new
String
(
buf
,
0
,
length
).
trim
());
break
;
case
ExifTag
.
TYPE_INT
:
for
(
int
i
=
0
;
i
<
tag
.
getComponentCount
();
i
++)
{
...
...
@@ -273,7 +278,7 @@ public class ExifParserTest extends InstrumentationTestCase {
parser
.
read
(
buffer
);
for
(
int
i
=
0
;
i
<
tag
.
getComponentCount
();
i
++)
{
if
(
i
!=
0
)
sbuilder
.
append
(
" "
);
sbuilder
.
append
(
buffer
[
i
]);
sbuilder
.
append
(
String
.
format
(
"%02x"
,
buffer
[
i
])
)
;
}
break
;
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment