mirror of
https://github.com/haraldk/TwelveMonkeys.git
synced 2025-08-05 04:25:29 -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<>();
|
List<Entry> entries = new ArrayList<>();
|
||||||
|
|
||||||
pInput.seek(pOffset);
|
pInput.seek(pOffset);
|
||||||
long nextOffset = -1;
|
|
||||||
|
|
||||||
long entryCount = readEntryCount(pInput);
|
long entryCount = readEntryCount(pInput);
|
||||||
|
|
||||||
@ -138,7 +137,8 @@ public final class TIFFReader extends MetadataReader {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (readLinked) {
|
if (readLinked) {
|
||||||
if (nextOffset == -1) {
|
long nextOffset;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
nextOffset = readOffset(pInput);
|
nextOffset = readOffset(pInput);
|
||||||
}
|
}
|
||||||
@ -146,16 +146,17 @@ public final class TIFFReader extends MetadataReader {
|
|||||||
// catch EOF here as missing EOF marker
|
// catch EOF here as missing EOF marker
|
||||||
nextOffset = 0;
|
nextOffset = 0;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Read linked IFDs
|
// Read linked IFDs
|
||||||
if (nextOffset != 0) {
|
if (nextOffset != 0) {
|
||||||
CompoundDirectory next = (CompoundDirectory) readDirectory(pInput, nextOffset, true);
|
CompoundDirectory next = (CompoundDirectory) readDirectory(pInput, nextOffset, true);
|
||||||
|
|
||||||
for (int i = 0; i < next.directoryCount(); i++) {
|
for (int i = 0; i < next.directoryCount(); i++) {
|
||||||
if(next.getDirectory(i).size() > 0) {
|
Directory directory = next.getDirectory(i);
|
||||||
// Linked directories might be empty if nextOffset is after EOF, so skip them
|
|
||||||
ifds.add((IFD) 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);
|
assertNotNull(exif);
|
||||||
assertEquals(23, exif.size());
|
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();
|
Directory interop = (Directory) exif.getEntryById(TIFF.TAG_INTEROP_IFD).getValue();
|
||||||
assertNotNull(interop);
|
assertNotNull(interop);
|
||||||
assertEquals(2, interop.size());
|
assertEquals(2, interop.size());
|
||||||
|
@ -206,7 +206,7 @@ public class TIFFReaderTest extends MetadataReaderAbstractTest {
|
|||||||
assertNotNull(exif);
|
assertNotNull(exif);
|
||||||
assertEquals(23, exif.size());
|
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();
|
Directory interop = (Directory) exif.getEntryById(TIFF.TAG_INTEROP_IFD).getValue();
|
||||||
assertNotNull(interop);
|
assertNotNull(interop);
|
||||||
assertEquals(2, interop.size());
|
assertEquals(2, interop.size());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user