Skip to content

Commit

Permalink
Merge pull request #642 from AndyDragon/andydragon/omsystem
Browse files Browse the repository at this point in the history
Added code to parse OM System II makernote (uses Olympus II makernote)
  • Loading branch information
drewnoakes authored Dec 15, 2023
2 parents e940f90 + 8ff04bc commit db9b141
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions Source/com/drew/metadata/exif/ExifTiffHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -435,16 +435,17 @@ private boolean processMakernote(final int makernoteOffset,

String cameraMake = ifd0Directory == null ? null : ifd0Directory.getString(ExifIFD0Directory.TAG_MAKE);

final String firstTwoChars = getReaderString(reader, makernoteOffset, 2);
final String firstThreeChars = getReaderString(reader, makernoteOffset, 3);
final String firstFourChars = getReaderString(reader, makernoteOffset, 4);
final String firstFiveChars = getReaderString(reader, makernoteOffset, 5);
final String firstSixChars = getReaderString(reader, makernoteOffset, 6);
final String firstSevenChars = getReaderString(reader, makernoteOffset, 7);
final String firstEightChars = getReaderString(reader, makernoteOffset, 8);
final String firstNineChars = getReaderString(reader, makernoteOffset, 9);
final String firstTenChars = getReaderString(reader, makernoteOffset, 10);
final String firstTwelveChars = getReaderString(reader, makernoteOffset, 12);
final String firstTwoChars = getReaderString(reader, makernoteOffset, 2);
final String firstThreeChars = getReaderString(reader, makernoteOffset, 3);
final String firstFourChars = getReaderString(reader, makernoteOffset, 4);
final String firstFiveChars = getReaderString(reader, makernoteOffset, 5);
final String firstSixChars = getReaderString(reader, makernoteOffset, 6);
final String firstSevenChars = getReaderString(reader, makernoteOffset, 7);
final String firstEightChars = getReaderString(reader, makernoteOffset, 8);
final String firstNineChars = getReaderString(reader, makernoteOffset, 9);
final String firstTenChars = getReaderString(reader, makernoteOffset, 10);
final String firstTwelveChars = getReaderString(reader, makernoteOffset, 12);
final String firstFourteenChars = getReaderString(reader, makernoteOffset, 14);

boolean byteOrderBefore = reader.isMotorolaByteOrder();

Expand All @@ -459,6 +460,12 @@ private boolean processMakernote(final int makernoteOffset,
// http://exiv2.org/makernote.html
pushDirectory(OlympusMakernoteDirectory.class);
TiffReader.processIfd(this, reader, processedIfdOffsets, makernoteOffset + 12, makernoteOffset);
} else if ("OM SYSTEM\0\0\0II".equals(firstFourteenChars)) {
// Olympus Makernote (OM SYSTEM)
// Note that data is relative to the beginning of the makernote
// http://exiv2.org/makernote.html
pushDirectory(OlympusMakernoteDirectory.class);
TiffReader.processIfd(this, reader, processedIfdOffsets, makernoteOffset + 14, makernoteOffset);
} else if (cameraMake != null && cameraMake.toUpperCase().startsWith("MINOLTA")) {
// Cases seen with the model starting with MINOLTA in capitals seem to have a valid Olympus makernote
// area that commences immediately.
Expand Down

0 comments on commit db9b141

Please sign in to comment.