Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added code to parse OM System II makernote (uses Olympus II makernote) #642

Merged
merged 1 commit into from
Dec 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The II suggests Intel byte ordering. Do we know if there's a similar MM variant for Motorola order?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not that I know of - this pattern matches all the photos I've taken with my OM1. I was under the assumption that the 'II' stood for the same indicator that the makernote was the Olympus second version since OM system bought the imaging division of Olympus and just stuck the new signature there.

// 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
Loading