Safe makernote types

Started by neebah, October 03, 2016, 05:07:09 PM

Previous topic - Next topic

neebah

I'm writing some software that edits the edit block and I don't want to damage the makernotes.  Of the known types which are safe to move in terms of offsets to the head of the exif data

neebah

Basically I don't want to update or touch makernotes unless I have to in order to make it exiftool safe :)

Hayo Baan

I don't think I fully understand your question, but as far as I know, exiftool leaves the whole makernote block at exactly the same spot in the file to prevent trouble (e.g. some undocumented relative and especially absolute pointers going haywire). All other metadata (exif, IPTC, XMP) can be moved to your hearts content as long as you keep all pointers pointing to the right locations (but these are all well known and documented so there should be no surprises).

Does this answer your question?
Hayo Baan – Photography
Web: www.hayobaan.nl

neebah

in a sense.  Yes.  Are pad bytes placed where needed to keep the makernote offset identical

neebah

I just tested the assumption that if a tag was deleted then the makernotes would still point to the same location.  The value offset was changed so apparently exiftool isn't keeping the same value offset for the makernotes, but must be doing this on a as needed basis. 

neebah

Just to clarify.  As a test I deleted the date taken and datedigitized tags and the makernotes offset was changed.  However the makernotes themselves were apple which I know doesn't use tags relative to the start of the tiff header.  They use tags relative to the maker note block.  So is exiftool taken each type of makernote into consideration and if so how does it handle unknown blocks. 

neebah

I was also thinking what if you added so many ifd0 and exif tags that it wasn't possible to keep the makernotes at the original offset value. 

Phil Harvey

ExifTool recalculates the offsets embedded in the makernote block when it moves them.  A minor warning is issued when writing unrecognized maker notes (because any offsets won't be updated).

- 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 ($).

neebah

However if one were making a photo album app with mild metadata editing capabilities one could take the strategy of do no harm to the makernotes by keeping the offset from the start of the tiff header the same right?

Phil Harvey

Keeping the original makernote is a good start, but it won't solve all of the problems.  This thread may be interesting to you.

- 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 ($).

neebah

Okay.  I read the thread but didn't see anything that could be a problem.  I'm writing my own editor and don't plan on using the offset schema tag.  What else should I consider to make this exiftool and makernote safe.  As long as I keep the original makernote offset the same. 

Phil Harvey

Did you see my comments about information being stored outside the makernote block?  Even if you keep the block in the same location you still need to worry about 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 ($).

neebah

Okay that information however won't pertain the to makernote block itself will it.  That should just be the original exif ifd information right?  I would have to make sure that the remaining values outside of the makernote block are reoffset and redistributed in order to keep the makernote block in the same spot. 

Phil Harvey

No.  Makernote information may lay outside the makernote data block.
...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 ($).

neebah

Really.  How is that and which types (as listed in your tag database) are the culprits

Phil Harvey

You can see for yourself.  I listed the models where show this problem.  You can download samples of each from here.  Look at them with the Exiftool -htmlDump feature.

- 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 ($).

neebah

Thanks Phil.  I'm trying to avoid the problem of changing too much exif in my app.  Would love to just edit XMP data.  But then I realized changing/adding camera and date information requires changing the exif data. 

neebah

Just to be clear.  All of these types have problems   ;D

neebah

I'm going to start a database of these issues from your list of files for makernotes that go by your typing system, camera sample, makernote structure and whether it is contained in the app1 segment of exif.  Would you be interested in hosting it.  Could be useful

Phil Harvey

I would have to see what your database looks like before I could answer this.  But my guess is that it wouldn't be worth posting because it would be of interest to only a very small number of people.

- 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 ($).

neebah

Is there a way to have exiftool output whether or not a photo has makernotes to a csv (yes/no result for the file(

Phil Harvey

exiftool -p "$filename,$makernotes:all" DIR

- 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 ($).