ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: jondw1970 on December 19, 2010, 03:26:46 AM

Title: Tidy up of a lot of messy images! (sorry lots of questions!)
Post by: jondw1970 on December 19, 2010, 03:26:46 AM
Hi, for a few days I have been looking at your tool and it is one of most comprehensive apps I have had the pleasure of coming accross!

My problem is that I have around 50,000 personal photos taken over last 10 years that are filed (messily) in folders/subfolders such as

Family
Holidays (then subfolder with SPAIN, UK, USA, etc)
Various
Pets

etc etc - within EACH of the above subfolders also is an AUDIO-VIDEO folder that will contain any AVI/MPEG/MP3 that might have been taken at the location etc

Not only that, I have a mixture of JPEG, NEF (Nikon) and the FUJI RAW file format (as have had different cameras over the years!) - Recently I have started taking RAW images and via IDIMAGER software are tagging/keywording using XMP (so have sidecar files)

All of the files I have are named their orgiinal DCSxxx (or whatever was orginally set etc) - and some (due to same naming/different camera) are the same name (but with a bracketed version number)  but different pictures...a right mess!

My ideal would be to point exiftool at the 'TOP' of my folder structure and for it to do the following

RENAME each IMAGE file by its IPTC date created date/time (something like 13-01-2010_15:30:00)
RENAME each VIDEO/AUDIO file by its FILECREATED date (as most dont have IPTC created) - structure as above

Then, move all files into one single file structure that is created by the dates above so my structure would look something like

2006
--Jan
----13
-----xxxx (filenames)

--Feb
----10
-----xxxx

2007
--Jan
---10
----xxxx

etc

I can then use IDIMAGER to track/keyword the images so I can put in virtual collections, and then can use idimager to format future new images into the new strcture

Phew....the question is - would ExifTool be able to do this? If you could give me some pointers on the example code for this (and could it also handle all the subfolders?) I would be grateful and work from that.

Id like the XMP files to also move with those images that already have the sidecar file (and be updated) - is this something that is supported, or would I just have to re keyword once the new structure in place

Finally (sorry for all the quesions) - for image files that DONT have any IPTC created dates, what happens to these in the process, are they logged and left 'in situ' (I would have to guess date/time rename manually?)

Many thanks again
Title: Re: Tidy up of a lot of messy images! (sorry lots of questions!)
Post by: jondw1970 on December 19, 2010, 04:09:46 AM
Hi, Ok I have now managed to get the rename part sorted - (inc XMP moves etc) - what I am not having much luck with is being able to then move to subfolders based on the files new date

So, my new date filenaming convention is

dd-mm-yy_hhmmss.%%%

Could Exiftool read the filename and then create and move to a new folder based on the new filename

eg a file with 13-10-11_135504.nef would be moved to a folder structure as

2011
--October
---11
----(filename)


Or would it have to read the date from the Exif??

Thanks
Title: Re: Tidy up of a lot of messy images! (sorry lots of questions!)
Post by: Phil Harvey on December 19, 2010, 07:32:26 AM
You say "lots of questions!", but I only see one because I only have one answer... :)

You can accomplish both the rename and the move of all the files in one command:

exiftool -d %Y/%B/%d/%d-%m-%Y_%H%M%S%%-c.%%e "-filename<datetimecreated" "-filename<createdate" "-filename<datetimeoriginal" -r DIR

I'm not sure what date/time tags you want to use, but here I have included 3 of the ones commonly found in various types of metadata.  The one that takes precedence for any given file is the last one on the command line that exists in that file.  If none of the specified tags exists, then a warning is issued and the file is not moved.

I have also added a "%-c" to the file name so that an extra index will be added to files if necessary to avoid a conflict with a file of the same name (ie. 2 files with the same extension and the same date/time value).  Without this, files are not moved if they would have had the same name as another file.

- Phil
Title: Re: Tidy up of a lot of messy images! (sorry lots of questions!)
Post by: jondw1970 on December 23, 2010, 11:57:25 AM
Great, finished for holidays now...will give it a go!