File Date to Exif Data - photo

I have a bunch of old folders containing photos from 2000s.
For an unknown reason photos are empty of Exif data.
But I want, at least, to keep the dates of each photo. So that they are in order when I import them in iCloud Photos.
Is there a software, or in command line way, or a script in any programming language, able to take each date inside 'file properties' and insert it in the photos' Exif data?
Thanks in advance.

You should be able to do this with exiftool. Make a backup of your files first, then try this on a single file:
exiftool "-alldates<filecreatedate" ONEIMAGE.jpg
Then check your "file properties" that you refer to and also check with:
exiftool ONEIMAGE.jpg
If that all looks correct, you can do all files in a directory like this:
exiftool "-alldates<filecreatedate" DIRECTORYNAME

Related

Create a file listing that contains the created date of the file

I'm trying to copy photos from someone's iphone to my windows laptop. The problem is the photos on the iphone save as filename like IMG 360, IMG 361 etc... but this isn't helpful when I want to copy these and organise by a certain filename and date created.
I use Google Photos and my own backup to organise photos in chronological order.
We went on holiday together and I am trying to find the best way to get their files organised and merged in with my own photos so that they appear in the right chronological order.
Unless there is a better way to do this, I am trying to create a file listing using a BAT file to list all the files together with their CREATED DATE and then I will create another BAT file to rename those files by incorporating their CREATED DATE.
Any ideas?
Thanks Chirag
I tried the below but this is supposed to only organise in chronological order, but it doesn't seem to even do that.
dir /a /b /-p /s /T:C /o:gen >filelisting.txt
You can use the command dir /T:C /O:D > filelisting.txt to create a file listing that contains the created date of each file in a directory.

Is it possible to extract metadata such as Content Created date from files - I can't get this with PowerShell

I need to extract the "Content Created" date out of thousands of files, but haven't been able to find a way to do this using PowerShell / other Command Line utility.
Does someone out there know a way to obtain this metadata? If so, please can you advise me. Thanks.
I've looked at various resources online, including this site, but haven't been successful thus far.
Here's a screenshot explaining what I'm trying to do.
I've been unable to find a native powershell cmdlet which does what you want. However, I found this article: Use PowerShell to Find Metadata from Photograph Files and the script it used: get file meta data function.
The article talks about image files, but the function is not specific for image files.
I tested it out on a folder containing a Word and an Excel file and the returned Metadata from the Word file contains the Content Created date. The Excel file does not contain/return that value. This is not unexpected as the Details tab of properties for the Excel file does not contain a Content Created value so it seems to be specific for Word files, and maybe some other file or document types.
Update:
You write that you need to extract this info from thousands of files, but if those files are anything but Word-files you probably won't be able to do that.
As far as I can tell this should work with the file types exposing the type of metadata you want. However, it seems that the ContentCreated property is unique to Word. I tried adding a text file (.txt), Acrobat PDF (.pdf), MS Access (.mdb), Excel (.xlxs) and a Word doc (.docx) file to my test folder and the only one that has/returns that metadata property is the Word file.
You should also be aware that the script seems to return metadata localized, so for me to programatically get the info i wanted I had to pipe the output of the script to Select-Object -Property Name,'InnehÄll skapat' (which is the Swedish name for Content created). So if you're running on a non-english system you may need to check what the output looks like before creating your Select-Object statement.
PowerQuery in Excel 2013 or later (data tab). Connect to data> Folder.

How to use Exiftool to copy jpg metadata to RAW file after exporting from Lightroom

Using Lightroom, I made adjustments to some jpg files (primarily to the toning), as well as added some IPTC data. I saved the metadata to those files and also exported them.
Now I would like to copy just the IPTC and edit adjustments from either the sorce jpgs or the exported jpgs into their corresponding RAW files, but I'm not sure of the syntax or tags to specify.
This is my folder structure:
.\Working
.\Working\RAW_Source\
.\Working\JPG_Source\
.\Working\JPG_Exports\
Notes:
all file names are the same except for their extensions.
there are no sidecar files involved. Metadata needs to exist ONLY in the jpg
or RAW files.
Thanks
Assuming that the files have the same base name, your basic command would be along these lines.
To copy from JPG_Source to RAW_Source
exiftool -TagsFromFile .\Working\JPG_Source\%f.jpg -xmp:all -iptc:all .\Working\RAW_Source\
To copy from JPG_Exports to RAW_Source
exiftool -TagsFromFile .\Working\JPG_Exports\%f.jpg -xmp:all -iptc:all .\Working\RAW_Source\
To copy tags from either source (latter DIR has priority)
exiftool -TagsFromFile .\Working\JPG_Exports\%f.jpg -xmp:all -iptc:all -TagsFromFile .\Working\JPG_Source\%f.jpg -xmp:all -iptc:all .\Working\RAW_Source\
That will copy all XMP tags (which includes IPTC Core) and IPTC IIM/Legacy tags to the RAW files.
These commands would create backup files which can be suppressed with the -Overwrite_Original option. You can recurse into subdirectories with the -r (recurse) option.
These commands do not include any GPS tags or EXIF tags. You can add the GPS tags by adding -GPS:All to the command. It's usually not a good idea to edit tags in the EXIF group in RAW files unless you know exactly what you are doing, as it can cause the RAW file to become unviewable, as some of these tags are needed to tell software how to render the image (see ExifTool FAQ #8).
Also take note that these command write the data directly into the RAW file. If you wish to write the data into an XMP sidecar file, the command would be more complex, depending upon whether the XMP sidecar files already exists or not. If the sidecar files already exist, then you would add -ext XMP to the above commands.

Extract previews in batch and name preview using inodes?

Is is possible to extract previews in batch (from images in a folder) and name the preview using the image's inode?
Example output:
path/to/previews_folder/{image_parent_folder_inode}/{image_inode}.jpg
Your question is a bit unclear, but if you are asking if exiftool can directly access inodes, then the answer is no. Exiftool does have it's FileName and Directory pseudo-tags which can be accessed and manipulated.

converting text file to gps track file

Note:Question is edited according to suggestion
I want to geotag my images
im1.jpg
im2.jpg
Content of Images
I tried the solution with csv but getting this error
I have a csv file adata.csv
SourceFile,DateTimeOriginal,GPSLatitude,GPSLongitude,GPSLatitudeRef,GPSLongitudeRef
im1.jpg,1635.387709,52.23829321,10.54680910,52.23829321,10.54680910
im2.jpg,1645.892446,52.23828047,10.54680857,52.23828047,10.54680857
C:\EXIF>exiftool -csv=adata.csv Images
Error:
C:\EXIF>exiftool -csv=adata.csv Images
No SourceFile 'Images/im1.jpg' in imported CSV database
(full path: 'c:/exif/images/im1.jpg')
No SourceFile 'Images/im2.jpg' in imported CSV database
(full path: 'c:/exif/images/im2.jpg')
1 directories scanned
0 image files read
I don't know much about the gpx format but your example doesn't include timestamps, which are required for exiftool to be able to sync between images and the track. Another thing to watch for is the fact that the gpx timestamps are supposed to be in UTC, which may require some work to sync properly, especially if the timestamps in your text file are local time.
Instead, I'd suggest converting your TXT file to a CSV file and using the -csv option. Some simple changes would be required. The first column would need to be changed to filenames, which it looks like would only require adding .jpg to each number in the first column. The column header for the first column would need to be changed to SourceFile. The Time column could be removed, unless you need to add the timestamps to the image files, in which case I'd suggest changing the column header to DateTimeOriginal. The Latitude and Longitude column headers need to be changed to GPSLatitude and GPSLongitude. Finally, because GPS metadata is unsigned, you will need to set the reference tags. Duplicate the GPSLatitude and GPSLongitude columns and change the headers to GPSLatitudeRef and GPSLongitudeRef. This all should be relatively easy in a spreadsheet program such as Excel or LibreOffice.
At that point your new CSV file should look like this:
SourceFile,DateTimeOriginal,GPSLatitude,GPSLongitude,GPSLatitudeRef,GPSLongitudeRef
1.jpg,13:22:05,45.9874167,-76.875233,45.9874167,-76.875233
You could then run this command to fill the gps data
exiftool -csv=data.csv c:\Images