6

I want to create a memories album and for that wanted to find all groups of photos that are on the same date, so that I can see what trend I can show across the years. It's similar to "Today in the years past" ...etc. This is ideal for birthdays, anniversaries ...etc.

I have looked at How to find all photos taken in April - any April? but they work only on a selected date, it doesn't get a me a set of photos and dates.

see the script in my previous question, that could possibly work.

Given an input set of images from years 2004 - 2014

Ideally the output needs to be something like this:

April 01 - Found: [img1, img2, img3 ...] Missing: []
January 31 - Found: [img34, img342, img54...] Missing: [2009,2004]

Basically, i need to be able to sort by MISSING count as well, so that I can filter for MISSING = 0 (i.e. found images in all years), or MISSING < 2 (missing a couple of years) ...etc.

Maybe this can be done with existing software?

  • Wouldn't this be better at stackoverflow.com? As this question can apply to photos, videos, and any other file that has a creation date. – Saaru Lindestøkke Mar 18 '14 at 15:21
  • 1
    This question appears to be off-topic because it is about file management – MikeW Mar 18 '14 at 18:58
  • 3
    I think this is probably still useful to a photographer, so I don't think it is off topic, but I do agree it will likely find a better answer on either super user or possibly stack overflow. – AJ Henderson Mar 18 '14 at 19:22
  • 1
    With regex, this would be easy, just /\d{4}-03-21/ for 21st march for dates formatted as YYYY-MM-DD. You could even do it in excel IF Date(0,Month,Day) = Date(0,3,21) – Vijay Mar 20 '14 at 3:09
  • 1
    A very low tech way which also allows flexibility is to perform a directory listing to a file, with parameters set to provide full path and date. This provides a record which can then be analysed with a programming language of choice. I have 8.6 million jpg images including duplicates and derivatives stored in various locations on 12+ drives, I create a single file as above using basic (agh!) DOS commands and then extract data subsets as required. File size is about 500 MB. There are various programs which will do similar for you but you are usually limited by their assumptions. Works well. – Russell McMahon May 20 '16 at 23:14
4

You should decouple three programming concerns. (I use Linux commands, but they work with Cygwin and MinGW, too).

  1. Finding and listing files. This can be done with find -iname "..." through folders.

  2. Extracting EXIF data. This can be done with exiftool.

1+2 can be easily coupled with xargs. E.g. this command lists all tags related to "Date" (it is one line, no line break intended). You should pick one for further processing.

find -iname "*.NEF" -print0 | xargs -0 -I {} exiftool -d "%Y, %m, %d" -All {} | grep "Date"

E.g. you can pick "Create Date" and filter for that in exiftool.

By the way, if you want to see all time information for a file, use:

exiftool -time:all -a -G0:1 -s myimage.NEF

And if your files are all within subdirectories, you can use the -r option (and skip the find command obviously.)

Now, this command outputs ALL the time information available, for your postprocessing:

find -iname "*.NEF" -print0 | xargs -0 -I {} exiftool -csv -time:all -filename -a -G0:1 {} >outputlist.txt

3 . Sorting, filtering. Now, this should be easy, use your constraints.

The very easiest is to pull the data into Excel and apply filters, or better, import to an SQL database, and query whatever you would like to query. You will see that different files contain different amount of timestamp data, and you have to reconcile that.

An alternative is to use the -X option instead of -csv, and generate XML output. This may or may not be easier to postprocess for you.

Now, if you are sure that e.g. CreateDate is what you need, you could try this:

find -iname "*.NEF" -print0 | xargs -0 -I {} exiftool -T -d "#Year#%Y# #Month#%m# #Day#%d#" -filename -CreateDate {} | grep "#Month#05#" | grep "#Day#07#"

I think it is obvious how I spiced up the initial find+exiftool command. It will find any images with the creation date having month == May and day == 7.

Good luck! ;-)

  • This is great! It addresses the key part of getting all the required information to do that analysis I want. The step of analysis is still pending though. I am using this command to gather the data: `exiftool . -r -csv -T -CreateDate -G -d "%Y-%m-%d" > test.csv" – Vijay Apr 3 '14 at 3:28
  • 1
    You can use any modern SQL engine to import CSV files. E.g. use Derby. See the procedure here. Then you can query using standard SQL SELECT commands for filenames satisfying a date constraing, or you can use GROUP to group files per date, or you can even use an OUTER JOIN to detect missing years. Your mileage vary ;-). But you can do processing in Excel easily, too, if it is an one-time challenge... – TFuto Apr 3 '14 at 9:22
  • In Excel, just split the date into three columns, and sort by (Month,Day). Then you will have a list of files per (Month, Day). – TFuto Apr 3 '14 at 9:24
  • To detect missing years for a (Month, Day), there are many ways, the easiest would be generating all the dates in your range of interest in a separate tab, then doing a VLOOKUP on each date targeting your collected data. Then Copy-Paste special-Values the results of the VLOOKUPs. Then sort by (Month,Date,Year). Then filter by the used-to-be-VLOOKUP column for missing match. 3 minutes work max. – TFuto Apr 3 '14 at 9:27
  • Thanks for the comments! Sorry I didn't see them, I've done the analysis in excel, see my answer below – Vijay Apr 3 '14 at 9:59
-1

Picasa from Google, a free program, organizes all of your photos by date. Once it finishes finding all of your photos you will be able to go to the particular date you want and find all photos taken on that date.

  • Does Picasa give the option of "all photos on 1st April, independent of year"? If not, I don't see how this solves Vijay's problem. – Philip Kendall Mar 24 '14 at 23:03
-1

Based on Tfuto's answer, I was able to generate a CSV file with the datecreated for my 17000 images:

exiftool . -ext .jpg -r -csv -T -CreateDate -G -d %Y-%m-%d > test.csv

This took 22 mins to run. I measured it using the powershell measure-command {cmd above} Then I used excel to analyze the file to come up something like the following:

DayMonth    MonthDay    YearsMissing    YearCount
01-Jan      01-01       20              6
26-Feb      02-26       21              5
08-Apr      04-08       21              5
12-Jun      06-12       21              5
31-Dec      12-31       21              5
03-Feb      02-03       22              4
13-Feb      02-13       22              4

This clearly gives me what I want, and you can see the dates on which I've had photos consistently across many years.

I don't think I can attach the excel file here, so let me know if you need it and I can mail it to you. I solved the problem with brute-force, as we have 366 days at max (leap years) and X number of years covered. (since the invention of exif in '93, 21 years so far, or 80 years over a person's lifespan). I just created a table like that and in each I check if that date exists in our data set, if yes mark it, if not leave it blank. In the end I can count the marks for each date to get the chart above. I also create a Pivottable that shows the count of files for each day & year, allowing further analysis and plotting. This actually also answers my earlier question Excel Pivottable

This gets me the common dates, but not the images themselves, I have to then filter the data according to the MonthDay I'm interested in and can see the list of images. I also created hyperlinks in the excel for the images & folders so I can click to view them directly.

I would think this exercise would have been a lot easier, if I could've written a plugin for a catalog app (like picasa). That's why it's important to have open access to your databases (API's).

As it stands, this is not a good solution for a computer novice to use. I think there is still a scope for improvement to create a simple app/script that does this for the user. (Maybe Damnion or Picasa or something else can do this. ) see some mobile apps

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.