Open

by damned truths

submit your photo


Hall of Fame
View past winners from this year

Please participate in Meta
and help us grow.

Take the 2-minute tour ×
Photography Stack Exchange is a question and answer site for professional, enthusiast and amateur photographers. It's 100% free, no registration required.

I wanted to see my trend of digital phototaking over the years. My hypothesis being that there is an upswing each time I acquire a new device (camera, phone ...etc.) and a boost with the advent of camera phones.

The simplest idea, I had was to gather the dates of each photo in a given set of photos (folder including subfolders), and then count the photos for each date.

Then plot this information in excel or some other tool. Preferably in a timeline sort of way with zooming in or out of data, i.e. change the axes from day to week, to month, to quarter to years.

Is there any utility that does this already very simply?

share|improve this question
    
If you use Lightroom this plugin might be helpful. –  Bart Arondson Feb 27 at 15:41
    
see my answer here as this solves the same problem in a different way, not with a satisfying plot though. –  Vijay Apr 3 at 10:11

3 Answers 3

I had a script which did something else, but it's easily modifiable to do what you want (at least the initial part):

from PIL import Image
from PIL.ExifTags import TAGS
import sys
import os
import getopt

def get_exif_data(fname):
    """Get embedded EXIF data from image file."""
    ret = {}
    try:
        img = Image.open(fname)
        if hasattr( img, '_getexif' ):
            exifinfo = img._getexif()
            if exifinfo != None:
                for tag, value in exifinfo.items():
                    decoded = TAGS.get(tag, tag)
                    ret[decoded] = value
    except IOError:
        print 'IOERROR ' + fname
    return ret

def main(argv):
    path = ''
    outputfile = ''
    try:
        opts, args = getopt.getopt(argv,"hp:o:",["path=","ofile="])
    except getopt.GetoptError:
        print argv[0] + ' -p <path> -o <outputfile>'
        print 'where:'
        print '\t<path> is the root directory path for all the images'
        print '\t<outputfile> is the CSV file to write to'
        sys.exit(2)
    for opt, arg in opts:
        if opt == '-h':
            print argv[0] + ' -p <path> -o <outputfile>'
            sys.exit()
        elif opt in ("-p", "--path"):
            path = arg
        elif opt in ("-o", "--ofile"):
            outputfile = arg

    if path == "" or outputfile == '':
        print 'error: arguments missing'
        sys.exit()
    if not os.path.isdir(path):
        print 'error: path entered is not a directory'
        sys.exit()
    photoCount = {}
    for root, dir, files in os.walk(path):
        for item in files:
            if item.lower().endswith(".jpg"):
                exif = get_exif_data(root + "\\" + item)
                if 'DateTime' in exif.keys():
                    date = exif['DateTime'][:10].replace(":","-")
                    if date in photoCount.keys():
                        photoCount[date] = photoCount[date] + 1
                    else:
                        photoCount[date] = 1

    outcsv = open( outputfile, 'w' )
    for key in photoCount.keys():
        outcsv.write(key + ',' + str(photoCount[key]) + '\n')

if __name__ == "__main__":
    main(sys.argv[1:])

When I run this on my sample directory (with a few folders of images), I get:

2011:06:21,6
2011:03:12,12
2012:03:09,168
2012:03:24,302
2011:08:27,58
2012:01:30,11
2012:02:13,848
2012:01:29,41
2012:01:21,7
2011:11:20,6
2012:01:24,25
2012:01:22,33

Ofcourse this needs to be sorted and all, but, this can be opened in excel and manipulated from there on.

share|improve this answer
    
This is awesome, this is almost exactly the script I was writing. I was just now working on the exif part! I even have the save 2 csv working, thought currently with file modified dates rather than exif dates. Let me test it out! –  Vijay Feb 27 at 8:54
    
For the plotting I was thinking of using something from here nbviewer.ipython.org –  Vijay Feb 27 at 8:56
    
Ok, it was a pain to install PIL on windows (had to rename the egg folder), and had to make a few changes to your code for it to work (case insensitive check, replace : with -) and I can confirm it works. –  Vijay Feb 27 at 9:46

You can use a DAM software that will collect all metadata from your images and display statistical info about who often did you take photos, by what cameras, lenses plus many other useful information:

enter image description here

share|improve this answer
    
The years might be expanded to months, that you can expand to days. You can even see the date trend per selected camera. –  Murat from Daminion Software Feb 26 at 12:00
    
Yes, I'd seen this on picajet's website but not on daminion's site. I even downloaded picajet but wasn't sure if I could do it in the free version so haven't tried yet. However, can I export this info and plot it? The key is I need a graph. –  Vijay Feb 27 at 2:47
1  
You can download the Daminion from daminion.net. It's free for managing small image collections (less than 15,000 files per one local catalog). At least you can check whether it works with you or no. You can export files and their properties (including dates) to CSV format and then try to build graphic in Excel (Item > Export > Export to CSV...) You can also try to work with Daminion catalogs directly: standalone version uses SQLite engine, multi-user version uses PostgreSQL. Both are open-source and free. –  Murat from Daminion Software Feb 27 at 7:18

It really depends what OS you are on and what you have.

If you are on Lnux, you could possibly use a recursive shell script to read the dates from image files and thus collect the data (without any further software).

If you have Adobe Lightroom you can sort images by date taken (if I am not mistaken). -> Go to Catalogue, all photos -> Metadata -> date Obviously as Murat suggested, many other photo editors can do the same.

You would need software that manages your library if you want an easy method of sorting photos and getting counts per year or even month or day etc.

share|improve this answer
    
I would prefer a cross-platform solution first, then windows only next. That's why a script is fine, as long as it's supported on all. I started writing a python script and have it working for regular files (saves a csv) but working on extracting the exif data using the regular libraries rather than a separate one. I've considered exiftool just cursorily, but maybe that could work the most effectively. –  Vijay Feb 27 at 2:49
    
If you want a cross platform solution then you only have two choices; 1) a script (or small program compiled from source) 2) a cross platform library manager (there are DigiKam and RawTherapee that are open source and cross platform but I am not sure how good their sorting facilities are.) –  DetlevCM Feb 27 at 9:04

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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