-
Notifications
You must be signed in to change notification settings - Fork 281
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
Changing Tag shortens MakerNote on Olympus JPEG #1081
Comments
What model camera is this? |
|
This model has maker notes that are actually much better behaved than other Olympus models, but the PreviewImage pointer seems to be invalid (in my sample at least), and points past the end of the file. It is possible that my file is missing the PreviewImage trailer, but it seems your file has the same problem. The MakerNotes are reduced in size because there is a lot of empty space (filled with garbage bytes) in the maker notes of this model. This empty space is removed when the maker notes are rewritten. Re-writing of the maker notes is necessary for some other Olympus models where the values of some MakerNote tags run outside the size of the MakerNote data block. Without this feature, these tags would be lost, so it wouldn't be advisable to disable this feature if possible. |
Thanks for the detailed explanation! I was guessing that it somehow fixes the file, but I would expect a warning when something like this is happening, at least on a higher debug level. Still, I would wish for an option to disable this behavior, as I want to do minimal changes to the files and the changes would be inconsistent to the other non-rotated files. |
Just for future reference, at least it seems like it is only rewriting the size of the MakerNote and is not doing more intrusive changes.
|
This doesn't make sense to me. In my sample the empty areas are scattered throughout the maker notes, so just changing the size wouldn't work. Could you attach both images so I can take a look? |
Ooops. This appears to be a rather serious Exiv2 bug. Apparently the original MakerNotes have been written to the file, but the size has been changed to that of the reformatted MakerNotes. :( Much of the MakerNotes may be lost if the edited image is subsequently edited by other software. |
Ops. Glad I could help to point it out! Can you point me to an alternative option to really only change the orientation tag? |
The same seems to happen for the raw files:
|
Sorry, I don't know of anything that can do this. ExifTool rewrites the MakerNotes and compresses the maker notes to 9270 bytes (the same size the Exiv2 writes), except that the compressed MakerNotes are properly written to the updated file. I'm not surprised that the same problem exists for raw files. |
Okay, thanks for your input. I noticed the more intrusive change in (your?) ExifTool, that is what got me to Exiv2. Nevertheless, thank you for the great work! It is highly appreciated :) I though so, that the raw files are handled similar. Let me know if I can help, providing test files or testing myself. |
One more thing: The file you posted does contain the PreviewImage trailer., and the PreviewImageStart 0x0101 tag is valid and correct, although it does point outside the EXIF data. Yes. I am the ExifTool author. |
Okay, what does that tell me? :) I'm pretty sure these are untouched originals, but I could later take new sample images. |
This means that there is no problem with the PreviewImage in your original JPG. It is more-or-less standard practice for the MakerNotes to reference a large PreviewImage outside the EXIF data. So I'm saying that you should ignore the Exiv2 warning for this. |
Oh, I see. Thanks, good to know! |
Happy New Year, everybody. This will be difficult to fix. I don't believe there's a work-around using exiv2. Exiv2 decodes the metadata and stores it in memory (with the readMetadata() function). If the metadata is modified and rewritten (with the writeMetadata() function), all metadata, including the makernote, is rebuilt and written to file. The Olympus makernote is illegally "pointing" outside it's data and that's what the warning message is about. It's coming from readMetadata(). It's rather odd that exiv2 should know the new length of the maker note, and write the old data. However exiv2 is very nervous about the PreviewImage. My thoughts? This is a tough puzzle. |
I've pushed this to Exiv2 v0.27.4 scheduled for June 2021. I'm not sure this can be fixed. My priority at present is Exiv2 v0.27.3 scheduled for June 2020. |
This looks like a tough puzzle. I'll set the milestone to v1.00. Setting the milestone means it will be consider for fixing. It doesn't guarantee that a contributor will take on the challenge. |
I want to change the orientation tag of the original JPEGs of my old Olympus camera without orientation sensor and leave the rest as it is. But exiv2 will also shorten the MakerNote Tag, I don't know if this is related to the warnings.
I'm not sure if this is a bug or intended behavior. In case it is intended and it somehow fixes the files to be standard conform, I miss a option to not do that.
The text was updated successfully, but these errors were encountered: