Bad xxxxxSubdir offset for tag 0x002b error

Started by rondomatika, September 04, 2013, 04:34:05 AM

Previous topic - Next topic

Phil Harvey

Interesting idea, and it comes close to working, but ExifTool doesn't fix up the offsets properly when you do this.  I'm not sure why... give me a bit of time to look into this.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

rondomatika

phil, sure please take your time...
i am very proud to hear that you thought this was an interesting idea.
after all i lack the most basic computer skills, and my experience with command line programs started yesterday morning with exiftool :)
anyhow, going back to your initial analysis of the DNG file that i sent you: you wrote the following:
Aside from corrupting the maker note offsets which is the reason for the error reported by ExifTool, it has also changed the byte ordering of the TIFF structure, which is a REAL NO-NO! 
do i understand this right? even if it would be possible to fix the maker notes, the "TIFF structure" will still remain damaged, or?
thanks again

Phil Harvey

Quote from: rondomatika on September 05, 2013, 07:39:46 AM
do i understand this right? even if it would be possible to fix the maker notes, the "TIFF structure" will still remain damaged, or?

Changing the byte ordering doesn't necessarily damage the file, but the problem is that you must be very, very careful when doing this, and it is very easy to break things, especially when it comes to proprietary metadata.  So even if we fix the maker notes, we could easily still have other problems.  For example, Ricoh software may expect the maker notes to be in the same byte order as the rest of the file.  But it is impossible to change the byte order of the maker notes without a complete knowledge of the data structures (which probably only Ricoh has), so it may be that even if you manage to "fix"  the maker notes, they could be unreadable by Ricoh software anyway.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Phil Harvey

#18
I looked into your idea of copying the maker notes.  Actually, the problem was that Adobe has also moved the maker notes from IFD0/ExifIFD/MakerNotes to the proprietary IFD0/DNGAdobeData, so you wind up with duplicate maker notes, including the old Adobe version with all of its problems.  And unfortunately ExifTool doesn't currently have the ability to add or delete the DNGAdobeData.

Just for fun, I will add the ability to do this in ExifTool 9.36, and with this version you will be able to use this command to try to recover the maker notes from a JPEG:

exiftool -tagsfromfile test.jpg -makernotes -dngadobedata= test.dng

However, there are other changes that the Adobe DNG converter made to the structure of this image, so it still will be different from the original Ricoh DNG.  So I don't see any real benefit to doing this to all of your images, and I don't think I would recommend it since it may now lead to and Adobe incompatibility.

(btw, this is the reason that I use the PEF image format instead of DNG for my Pentax cameras -- the Adobe utilities modify the DNG without warning, but they don't touch the PEF.)

- Phil

...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

rondomatika

Phil, thank you, very interesting.
I may also try this "just for fun", with the new version. But I got your message: sounds like a bad idea to use it for global "fix" of files. I have been experimenting with a lot of image editors since you made me aware of the potential problems, and so far it seems fine.
Still very troubled by all these...
So after all, it looks like we really need a truly open source alternative to DNG. Or, a third party DNG converter that is less invasive?