mirror of
https://github.com/haraldk/TwelveMonkeys.git
synced 2025-08-04 20:15:28 -04:00
#368 related clean-up
This commit is contained in:
parent
3f06bbee99
commit
2b29c14593
@ -120,7 +120,6 @@ public final class TIFFReader extends MetadataReader {
|
||||
List<Entry> entries = new ArrayList<>();
|
||||
|
||||
pInput.seek(pOffset);
|
||||
long nextOffset = -1;
|
||||
|
||||
long entryCount = readEntryCount(pInput);
|
||||
|
||||
@ -138,14 +137,14 @@ public final class TIFFReader extends MetadataReader {
|
||||
}
|
||||
|
||||
if (readLinked) {
|
||||
if (nextOffset == -1) {
|
||||
try {
|
||||
nextOffset = readOffset(pInput);
|
||||
}
|
||||
catch (EOFException e) {
|
||||
// catch EOF here as missing EOF marker
|
||||
nextOffset = 0;
|
||||
}
|
||||
long nextOffset;
|
||||
|
||||
try {
|
||||
nextOffset = readOffset(pInput);
|
||||
}
|
||||
catch (EOFException e) {
|
||||
// catch EOF here as missing EOF marker
|
||||
nextOffset = 0;
|
||||
}
|
||||
|
||||
// Read linked IFDs
|
||||
@ -153,9 +152,11 @@ public final class TIFFReader extends MetadataReader {
|
||||
CompoundDirectory next = (CompoundDirectory) readDirectory(pInput, nextOffset, true);
|
||||
|
||||
for (int i = 0; i < next.directoryCount(); i++) {
|
||||
if(next.getDirectory(i).size() > 0) {
|
||||
// Linked directories might be empty if nextOffset is after EOF, so skip them
|
||||
ifds.add((IFD) next.getDirectory(i));
|
||||
Directory directory = next.getDirectory(i);
|
||||
|
||||
// Linked directories might be empty if nextOffset is after EOF (skip these)
|
||||
if (directory.size() > 0) {
|
||||
ifds.add((IFD) directory);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -192,7 +192,7 @@ public class EXIFReaderTest extends MetadataReaderAbstractTest {
|
||||
assertNotNull(exif);
|
||||
assertEquals(23, exif.size());
|
||||
|
||||
// The interop IFD is empty (entry count is 0)
|
||||
// The interop IFD with two values
|
||||
Directory interop = (Directory) exif.getEntryById(TIFF.TAG_INTEROP_IFD).getValue();
|
||||
assertNotNull(interop);
|
||||
assertEquals(2, interop.size());
|
||||
|
@ -206,7 +206,7 @@ public class TIFFReaderTest extends MetadataReaderAbstractTest {
|
||||
assertNotNull(exif);
|
||||
assertEquals(23, exif.size());
|
||||
|
||||
// The interop IFD is empty (entry count is 0)
|
||||
// The interop IFD with two values
|
||||
Directory interop = (Directory) exif.getEntryById(TIFF.TAG_INTEROP_IFD).getValue();
|
||||
assertNotNull(interop);
|
||||
assertEquals(2, interop.size());
|
||||
|
Loading…
x
Reference in New Issue
Block a user