How to import Exif data from a .csv file into a picture!

Started by goofly, April 02, 2021, 07:28:48 PM

Previous topic - Next topic

goofly

Hi there,

I'm sorry if this type of questions were already asked in the forum but they didn't work for me!
I've learned from the Exiftool FAQ how to export metadata from an image file to a csv or txt file and I'm also aware that importing metadata to another image file works only with csv / json format databases.

In my case I have two images that I both took using my phone except that the last one was cleared from its metadata using the following command in a Powershell terminal:

exiftool -all= "C:\Users\X\Desktop\image_2.jpg"

Then I've created a .csv file that contains the metadata of the 1st image using this command:

exiftool -csv "C:\Users\X\Desktop\image_1.jpg" > "C:\Users\X\Desktop\data.csv"

Now I want to import the tags found in that csv database to the second image and this is the command I used:

exiftool -csv="C:\Users\X\Desktop\data.csv" "C:\Users\X\Desktop\image_2.jpg"

But I keep getting this error:

Invalid tag name ' ■S o u r c e F i l e ' in CSV file
No SourceFile 'C:/Users/X/Desktop/image_2.jpg' in imported CSV database
(full path: 'c:/users/x/desktop/image_2.jpg')

I've attached the csv file I generated to this thread if anyone would want to get a look at it.

Regards

StarGeek

You need to open up the CSV file, in either a spreadsheet program or text editor like notepad, change the entry that says C:\Users\X\Desktop\image_1.jpg to the name of the file you want to write, in this case change it to C:\Users\X\Desktop\image_2.jpg.  If you used a spreadsheet program, make sure you save it as a CSV file.

But an easier thing would be to copy all the tags directroy from image_1.jpg to image_2.jpg with this command
exiftool -TagsFromFile C:\Users\X\Desktop\image_1.jpg -All:All C:\Users\X\Desktop\image_2.jpg
* 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).

goofly

Quote from: StarGeek on April 02, 2021, 08:03:41 PM
You need to open up the CSV file, in either a spreadsheet program or text editor like notepad, change the entry that says C:\Users\X\Desktop\image_1.jpg to the name of the file you want to write, in this case change it to C:\Users\X\Desktop\image_2.jpg.  If you used a spreadsheet program, make sure you save it as a CSV file.

But an easier thing would be to copy all the tags directroy from image_1.jpg to image_2.jpg with this command
exiftool -TagsFromFile C:\Users\X\Desktop\image_1.jpg -All:All C:\Users\X\Desktop\image_2.jpg

Thanks for your prompt reply!

I've tried both of the methods you mentioned above but none of them actually worked for me!
I made a video recording myself while applying what you suggested.

The -TagsFromFile option didn't generate any error but in the same time it did not copy all the tags directory from the 1st image to the 2nd one!
Link to the video: https://streamable.com/4hamdc

Regards

StarGeek

It helps if you use the command listed in FAQ #3 as that will show you the groups those tags belong to as well as any duplicately named tags.  In this case, it looks like all that data is part of the ICC_ProfileICC_Profile tags cannot be copied individually (see ICC_Profile tags page) but the profile can be copied as a block (see listing under the Extra tags page).  But, because the ICC_Profile can significantly alter the colors of an image, it is considered unsafe to copy (as indicated by the exclamation point under the writable column on the Extra tags page).  As such, it must be explicitly named in order to copy it.

In order to copy it, you would add -ICC_Profile after the -All:All, though if you're copying that, you probably should copy the other unsafe color tags by using the -ColorSpaceTags shortcut.
exiftool -TagsFromFile Image_1.jpg -All:All -ColorSpaceTags Image_2.jpg

But as I said, this can alter the colors of the image and you wouldn't want to copy these tags to a completely different image.
* 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).