How can I copy the metadata perfectly ?

Started by hugh_shaw, January 12, 2023, 04:43:18 AM

Previous topic - Next topic

hugh_shaw

Hello Harvey, I have a need to perfectly copy the EXIF DATA from an  image to another .

When doing the split test, I directly copy "Image ORG"  as a new file named "Image TEST" , and the "Image TEST" files Delete all the exif data , and then re-import the data from "Image ORG" to "Image TEST".
Finally, I used winhex to check the hexadecimal data of tow files , but I found that the data of the two pictures were not exactly the same. I guess it was because some programs were not copied perfectly when us tagsfromfiles. How can I use EXIFTOOL to copy the exif data perfectly to another image?

Attached are pictures and a screen recording video of my operation.
Thank you very much for your answer!
IMAGE.rar
 

wywh

Does this explain the issue:

9b. "The tag locations change when I use -tagsfromfile to copy information"

https://exiftool.org/faq.html#Q9

Phil Harvey

FAQ 13 also applies here.

To most closely approximate the structure of the original metadata, the EXIF should be copied as a block:

exiftool -tagsfromfile SOURCE_FILE -exif TARGET_FILE

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

hugh_shaw

Thank you very much for your reply.
Another question is, when I modify some parameters, why do I also modify my winhex value? Instead of just modifying the part I changed?
For example the picture "org.jpg", when I use the command  "exiftool -s -make="mimimi" test5.jpg"to modifying the -MAKE value. It will prompt "Warning: [minor] Entries in IFD0 were out of sequence. Fixed."and then I checking the hex value, it is found that not only MAKE has been changed. I'm guessing it's a problem with the data format.
If I want to change the value without changing the data location, how should I do it.

Thanks again!



Phil Harvey

If you want to change a value and nothing else, I think your only option is a hex editor.

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

hugh_shaw

Quote from: Phil Harvey on January 13, 2023, 03:36:18 PMIf you want to change a value and nothing else, I think your only option is a hex editor.

- Phil

What a sad news, is there no way to solve this problem other than a HEX editor? For example by exiftool

actually when without that warning "[minor] Entries in IFD0 were out of sequence. Fixed.", modifying the tag doesn't change any other information, is there a way not to trigger the autofix?

Phil Harvey

Even if that fix was disabled, other things would be changed in the file.  (Did you read FAQ 13?)

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

StarGeek

Is there a reason you feel the need to keep everything exactly the same?  You're not losing any metadata after exiftool edits it and exiftool is correcting a error so you won't have any problems with other software.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

hugh_shaw

Quote from: StarGeek on January 14, 2023, 04:20:17 PMIs there a reason you feel the need to keep everything exactly the same?  You're not losing any metadata after exiftool edits it and exiftool is correcting a error so you won't have any problems with other software.

In fact,it is necessary for my current project. I need to completely imitatethe picture format of other manufacturers' cameras. but there is no any information on this 。

hugh_shaw

Quote from: Phil Harvey on January 14, 2023, 08:19:48 AMEven if that fix was disabled, other things would be changed in the file.  (Did you read FAQ 13?)

- Phil


Thank you for your answer. During this period of time, I have read the exiftool information for a long time, as well as the libraries of other programs in github. Basically, they will change the exif arrangement when modifying the EXIF data. Is any way to change the data without changing the data arrangement other than directly using the hex editor? After all hex editors are hard to use.

thanks again

Phil Harvey

Using a hex editor is the only way that I know.

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

hugh_shaw

Quote from: Phil Harvey on February 22, 2023, 07:28:06 AMUsing a hex editor is the only way that I know.

- Phil

Maybe I can try to make this program 

Gabbo