Hi, I think I have come to the right place.
The problem.
I have about 20,000 images, about half of which are scanned from prints, negatives and transparencies. Those from digital sources usually have the correct date and time stamp (except those I sometimes receive from others who don't bother setting their camera/smart phone dates accurately). Now as I can't rely on any metadata date to sort chronologically (some scans I have accurate taken dates for, many I do not), I use a simple folder & file naming convention to get the basic chronological order correct, based on an estimated month/year for those files where I do not have a date taken. So for example, a file may be called '2003-07 047', meaning the 47th photo in July, 2003; for this file the only date I will have is the scanned in date.
I have recently installed a QNAP NAS serving photos, music and videos to the TV and other devices. There is no option to sort by filename and as I can't rely on dates, then I can't view about half of my collection chronologically. However, I can sort by date taken and title. All of my images have titles.
I think changing date taken would be a monumental effort. However, I feel in my bones that there must be some relatively simple batch way to prefix a sequential count number into the title field. This could be done by either prefixing a simple sequential number (001,002,003..) or by adding the filename as a prefix.
So: 'Tom & Eliza at the Amersham Fair' becomes either '047 Tom & Eliza at the Amersham Fair' or '2003-07 047 Tom & Eliza at the Amersham Fair'. This would then enable them to be sorted chronologically.
I'd be grateful of any help or pointers - even if only to say I am barking up the wrong tree and there is a much simpler solution. I have raised the issue with QNAP.
Warning - I have very little experience of command level stuff, but would obviously get it right on a small sample before engaging on a mass change. Back in the day I used to be a programmer, so that would help.
Thanks in anticipation.
Or is it the XMP data I need to change? See? That's how much I [don't] know.
First you have to figure out what metadata can be used by your software to sort images.
Then you can use ExifTool to copy/restructure/write the metadata into the proper location.
Are we talking about JPEG images here? If so, EXIF;DateTimeOriginal may be what you want to write. To set this from the file name with a YYYY-mm prefix, you could do something like this:
exiftool -if "not $datetimeoriginal" "-datetimeoriginal<${filename;s/ .*//}-01 00:00:00" -r DIR
This sets DateTimeOriginal from the first part of the file name (before the first space), then adds a day (01) and time. The -if condition is used to write only files that don't already have a DateTimeOriginal. The -r option recursively processes any subdirectories.
- Phil
Thanks Phil, that's given me an excellent place to start.
As you say, I need to be sure what tags my apps are using. All the files are jpegs.
I'll start experimenting with small subsets of files and see how I get on - and report back on success.
btw - QNAP assure me that sort by filename will be available in their next s/w release.
Phil
Trying to sort out this problem has been a great lesson for me. The greatest lesson is that my tags are inconsistent, having been created over the years by different software such as picasa, microsoft photo gallery (please don't laugh), file explorer, etc. I should know better - always analyse the data before asking for a solution.
The upshot is that I don't think I can safely apply batch commands to groups of files by assuming what's in the tags. In some cases, each file may have to be considered separately. So, pain that it is, I need to take a more labour-intensive approach by exporting the data, running it through some excel macros and then importing it back. I've done this with a few test folders and it's not as bad as it sounds.
Thanks for your help. I will use a decent tool (exiftool) in future.