ExifTool Forum

General => Metadata => Topic started by: VladoBENZ on October 20, 2019, 02:02:14 PM

Title: Places of JFIF, IFD0 etc.
Post by: VladoBENZ on October 20, 2019, 02:02:14 PM
Hello, guys, my question is maybe pointless, but I need to know if somebody knows the answer to it. Basically many times I edit photos, or more fix them, I need them to keep the exact metadata of the original file. So I do this with the command "exiftool -tagsfromfile *** -all:all -unsafe ***". But I noticed that sometimes exiftool copies everything, but sometimes it put them on different offsets, so to speak. for example when I compare both of the files with the command "exiftool -a -G1 -s -u ***", on the 1st file it returnes me for example:
[File]          ***
[IFD0]          ***
[ExifIFD]       ***
[GPS]           ***
[IFD1]          ***
[JFIF]          ***
[Composite]     ***
and the second one returns:
[File]          ***
[IFD0]          ***
[JFIF]          ***
[ExifIFD]       ***
[GPS]           ***
[IFD1]          ***
[Composite]     ***

My question is, why exiforder changed the order of JFIF tags, in the original files they come at the end, before composite, and on the 2nd file the order is different, they come after the ifd0 tags. Sorry if my question is very confusing, I hope someone will understand me. I attached these two photos for example.
Title: Re: Places of JFIF, IFD0 etc.
Post by: StarGeek on October 20, 2019, 02:14:53 PM
See FAQ #13 (https://exiftool.org/faq.html#Q13).

Exiftool doesn't edit a file "in-place".  It creates a new copy, often restructuring the metadata because that is what is required to add/remove data, and replaces the original with the new copy.  When any data is changed, the offsets need to be updated and there are a lot of programs out there that don't properly do this, which leads to situations like FAQ #15 (https://exiftool.org/faq.html#Q15).

As long as the program you want to use with your files knows how to properly reads the the metadata, this shouldn't be a problem.  But there are very badly written programs out there that don't do so. 
Title: Re: Places of JFIF, IFD0 etc.
Post by: VladoBENZ on October 20, 2019, 03:20:44 PM
Yes, yes...I kinda knew that, thank you for explaining it to me though. But my question actually is can I "tell" exiftool where to put for example the JFIF block manually...in order to make the offset value tags the same as in the original file, or I cannot do that at all, and I should just accept that some offset tag value will be changed? Just to clarify, Im absolute fan of exiftool and I love it, and I know the quality of the pics is not affected, I just noticed that because of this I cannot make the metadata of the edited file completely the same as in the other pics, shot by the same camera.
Title: Re: Places of JFIF, IFD0 etc.
Post by: Phil Harvey on October 20, 2019, 04:33:47 PM
Quote from: VladoBENZ on October 20, 2019, 03:20:44 PM
can I "tell" exiftool where to put for example the JFIF block manually...in order to make the offset value tags the same as in the original file

There is no way to do this with ExifTool.

- Phil