ExifTool Forum

General => Metadata => Topic started by: neebah on October 03, 2016, 05:07:09 PM

Title: Safe makernote types
Post by: neebah on October 03, 2016, 05:07:09 PM
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
Title: Re: Safe makernote types
Post by: neebah on October 03, 2016, 05:10:58 PM
Basically I don't want to update or touch makernotes unless I have to in order to make it exiftool safe :)
Title: Re: Safe makernote types
Post by: Hayo Baan on October 04, 2016, 01:39:19 AM
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?
Title: Re: Safe makernote types
Post by: neebah on October 04, 2016, 06:21:04 AM
in a sense.  Yes.  Are pad bytes placed where needed to keep the makernote offset identical
Title: Re: Safe makernote types
Post by: neebah on October 04, 2016, 06:28:12 AM
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. 
Title: Re: Safe makernote types
Post by: neebah on October 04, 2016, 08:37:13 AM
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. 
Title: Re: Safe makernote types
Post by: neebah on October 04, 2016, 09:44:57 AM
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. 
Title: Re: Safe makernote types
Post by: Phil Harvey on October 04, 2016, 11:04:26 AM
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
Title: Re: Safe makernote types
Post by: neebah on October 04, 2016, 11:27:47 AM
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?
Title: Re: Safe makernote types
Post by: Phil Harvey on October 04, 2016, 11:34:47 AM
Keeping the original makernote is a good start, but it won't solve all of the problems.  This thread (https://www.dpreview.com/forums/post/21900411) may be interesting to you.

- Phil
Title: Re: Safe makernote types
Post by: neebah on October 04, 2016, 12:31:22 PM
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. 
Title: Re: Safe makernote types
Post by: Phil Harvey on October 04, 2016, 12:41:59 PM
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
Title: Re: Safe makernote types
Post by: neebah on October 04, 2016, 01:28:52 PM
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. 
Title: Re: Safe makernote types
Post by: Phil Harvey on October 04, 2016, 02:05:29 PM
No.  Makernote information may lay outside the makernote data block.
Title: Re: Safe makernote types
Post by: neebah on October 04, 2016, 02:35:38 PM
Really.  How is that and which types (as listed in your tag database) are the culprits
Title: Re: Safe makernote types
Post by: Phil Harvey on October 04, 2016, 03:10:21 PM
You can see for yourself.  I listed the models where show this problem.  You can download samples of each from here (https://exiftool.org/sample_images.html).  Look at them with the Exiftool -htmlDump feature.

- Phil
Title: Re: Safe makernote types
Post by: neebah on October 04, 2016, 03:25:35 PM
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. 
Title: Re: Safe makernote types
Post by: neebah on October 04, 2016, 03:30:31 PM
Just to be clear.  All of these types have problems   ;D
Title: Re: Safe makernote types
Post by: neebah on October 05, 2016, 04:00:12 PM
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
Title: Re: Safe makernote types
Post by: Phil Harvey on October 05, 2016, 04:26:45 PM
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
Title: Re: Safe makernote types
Post by: neebah on October 05, 2016, 06:21:40 PM
Is there a way to have exiftool output whether or not a photo has makernotes to a csv (yes/no result for the file(
Title: Re: Safe makernote types
Post by: Phil Harvey on October 05, 2016, 09:24:35 PM
exiftool -p "$filename,$makernotes:all" DIR

- Phil