Skip to content

Commit

Permalink
Only considering makernote as being processed if it actually was, oth…
Browse files Browse the repository at this point in the history
…erwise raw bytes inserted into directory.
  • Loading branch information
drewnoakes committed Jan 8, 2013
1 parent 03b80ef commit 3e48ead
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Source/com/drew/metadata/exif/ExifTiffHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,7 @@ public boolean customProcessTag(final int makernoteOffset,
{
// In Exif, we only want custom processing for the Makernote tag
if (tagId == ExifSubIFDDirectory.TAG_MAKERNOTE && _currentDirectory instanceof ExifSubIFDDirectory) {
processMakernote(makernoteOffset, processedIfdOffsets, tiffHeaderOffset, reader);
return true;
return processMakernote(makernoteOffset, processedIfdOffsets, tiffHeaderOffset, reader);
}

return false;
Expand All @@ -124,7 +123,7 @@ public void completed(@NotNull final RandomAccessReader reader, final int tiffHe
}
}

private void processMakernote(final int makernoteOffset,
private boolean processMakernote(final int makernoteOffset,
final @NotNull Set<Integer> processedIfdOffsets,
final int tiffHeaderOffset,
final @NotNull RandomAccessReader reader) throws IOException
Expand All @@ -133,7 +132,7 @@ private void processMakernote(final int makernoteOffset,
Directory ifd0Directory = _metadata.getDirectory(ExifIFD0Directory.class);

if (ifd0Directory == null)
return;
return false;

String cameraMake = ifd0Directory.getString(ExifIFD0Directory.TAG_MAKE);

Expand Down Expand Up @@ -268,9 +267,11 @@ private void processMakernote(final int makernoteOffset,
} else {
// The makernote is not comprehended by this library.
// If you are reading this and believe a particular camera's image should be processed, get in touch.
return false;
}

reader.setMotorolaByteOrder(byteOrderBefore);
return true;
}

private static void processKodakMakernote(@NotNull final KodakMakernoteDirectory directory, final int tagValueOffset, @NotNull final RandomAccessReader reader)
Expand Down

0 comments on commit 3e48ead

Please sign in to comment.