Author Topic: Copying or applying all metadata form one image to another  (Read 5142 times)

0 Members and 1 Guest are viewing this topic.

Bernie

  • Member
  • **
  • Posts: 14
    • View Profile
Hi,
I'm sometime using other tools to do change to an image (let's say perspective transformation
on photographied documents).
Some transformations lead to all metadata being deleted  :(
I'm therfeore looking for a way to copy all metadata from one file (a backup copy of the file)
to the changed image (or to reapply existing Thumbs gatherred metadata to the
file after being edited).
Is that possible?

Regards,
Bernard

Daan van Rooijen

  • Administrator
  • Sr. Member
  • *****
  • Posts: 946
    • View Profile
No, I don't think that can be done with ThumbsPlus.

Apparently XnView can do this (see here), so, maybe have a look at that.
I'm volunteering as a moderator - I do not work for Cerious Software, Inc.

pie.photo

  • Member
  • **
  • Posts: 10
    • View Profile
I use the exiftool program for this purpose.  ->  https://exiftool.org/
To copy all metadata from sourcefile to targetfile you can use this command:
exiftool -tagsfromfile sourcefile.jpg "-all:all>all:all" targetfile.jpg

I also use exiftool to write the data of a lens to the image file, which does not transfer any data to the camera.
exiftool is a very powerful command line tool. The program has been regularly updated for many years and is also used by many other programs.
Hope, this helps.
Ernst

Bernie

  • Member
  • **
  • Posts: 14
    • View Profile
Hi,
Thanks to both of you  :)
I will have a look to both.
Best regards,
Bernie

Bernie

  • Member
  • **
  • Posts: 14
    • View Profile
@Pie.Photo

Hi,
I tested something like this:
exiftool -tagsfromfile @ "-all:all>all:all" "Copy of "%f.jpg

to try reapplying all metadata from original file to their copies in the same folder.
But this don't works (I initially suspected issue with spaces in filename but
changing target files to Copy_of_ don't change behavior.

I did try many alternatives but finally always got: ("Win10>CMD" in non admin mode)
Warning: Error opening file - %dCopie_de_%f.%e
Error: File not found - %dCopie_de_%f.%e
    0 image files updated
    1 files weren't updated due to errors
    0 output files created

(this one when using following target:
%d"Copie_de_"%f.%e

Any quick hint? (may be moving to exiftool forum!)

@Daan
I had a try at xnview MP but don't found easy way to reapply Metadata of a lot of images to
their respectives copy.
(may be I have issues because I'm not using X64... and therefore XNview (32bits version) is
much older than in x64).

Have a nice day at your respective side.
Regards
Bernie

pie.photo

  • Member
  • **
  • Posts: 10
    • View Profile
I'm sorry, I've completely lost focus on this forum. I only remembered today that I had posted an answer here.
I understand - you want to edit several files with one command call. I haven't needed this yet because I always check or update the metadata immediately after editing an image. But I understand your problem - you have a lot of image files whose metadata is incomplete or lost and you don't want to update each image file individually.

This maybe the solution: https://exiftool.org/forum/index.php?topic=2205.msg9659#msg9659
I've created the following scenario to test it and it seems to work fine:

In the current directory I have a lot of TIFF-files with complete metadata. In the subdirectory JPG there are the same files with same names but JPEGs and missing metadata. Now Now I would like to copy the metadata of the TIFF files into the JPEG files of the same name.
I open Windows Commandline "cmd" and change to the directory where I have my TIFF-files. There I start the following command:
exiftool -tagsfromfile %f.tif JPG -ext jpg                             (JPG is the directory, where the jpg-files without metadata reside)
Now all metadata has been restored. Camera data, location, keywords, .... have been copied to my JPEG-files.
I think, this is what you need(?)

If source and destination files are JPEGs, then you can use this command:
exiftool -tagsfromfile %f.jpg JPG                                       (now you do not need the -ext option, because source and destination have the same suffix)

I am not a exiftool guru but I found solutions for the problems that I had with exiftool. If you need something special, please contact the exiftool forum.

Good luck!
Ernst

Bernie

  • Member
  • **
  • Posts: 14
    • View Profile
Hi Ernst,
Many thanks, I will have try at (may be y issue was using @ instead of %f !).
(i did workaround command line error before your post using an Excel macro to generate a .bat command containing
one exiftool call per file... for sure more complex than what to suggested  :) )
Thanks again.
Best regards
Bernie