mirror of
https://github.com/haraldk/TwelveMonkeys.git
synced 2025-08-05 20:45:29 -04:00
TMI #166 Remove printStackTrace() from EXIFReader
This commit is contained in:
parent
4b70b0cf1c
commit
99c5fea005
@ -89,8 +89,8 @@ public final class EXIFReader extends MetadataReader {
|
|||||||
|
|
||||||
// TODO: Consider re-writing so that the linked IFD parsing is done externally to the method
|
// TODO: Consider re-writing so that the linked IFD parsing is done externally to the method
|
||||||
protected Directory readDirectory(final ImageInputStream pInput, final long pOffset, final boolean readLinked) throws IOException {
|
protected Directory readDirectory(final ImageInputStream pInput, final long pOffset, final boolean readLinked) throws IOException {
|
||||||
List<IFD> ifds = new ArrayList<IFD>();
|
List<IFD> ifds = new ArrayList<>();
|
||||||
List<Entry> entries = new ArrayList<Entry>();
|
List<Entry> entries = new ArrayList<>();
|
||||||
|
|
||||||
pInput.seek(pOffset);
|
pInput.seek(pOffset);
|
||||||
long nextOffset = -1;
|
long nextOffset = -1;
|
||||||
@ -156,7 +156,7 @@ public final class EXIFReader extends MetadataReader {
|
|||||||
try {
|
try {
|
||||||
if (KNOWN_IFDS.contains(tagId)) {
|
if (KNOWN_IFDS.contains(tagId)) {
|
||||||
long[] pointerOffsets = getPointerOffsets(entry);
|
long[] pointerOffsets = getPointerOffsets(entry);
|
||||||
List<IFD> subIFDs = new ArrayList<IFD>(pointerOffsets.length);
|
List<IFD> subIFDs = new ArrayList<>(pointerOffsets.length);
|
||||||
|
|
||||||
for (long pointerOffset : pointerOffsets) {
|
for (long pointerOffset : pointerOffsets) {
|
||||||
CompoundDirectory subDirectory = (CompoundDirectory) readDirectory(input, pointerOffset, false);
|
CompoundDirectory subDirectory = (CompoundDirectory) readDirectory(input, pointerOffset, false);
|
||||||
@ -177,12 +177,15 @@ public final class EXIFReader extends MetadataReader {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (IIOException e) {
|
catch (IIOException e) {
|
||||||
|
if (DEBUG) {
|
||||||
// TODO: Issue warning without crashing...?
|
// TODO: Issue warning without crashing...?
|
||||||
|
System.err.println("Error parsing sub-IFD: " + tagId);
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private long[] getPointerOffsets(final Entry entry) throws IIOException {
|
private long[] getPointerOffsets(final Entry entry) throws IIOException {
|
||||||
long[] offsets;
|
long[] offsets;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user