def FilePic(rawFolder, base, filename, newName, y, m, d): 
    """
    Files the input image according to date taken --> 2006/07/09
    /Users
      /Chad
        /Pictures
          /2006
            /07
              /09
                image goes here
    --------------------------------------------------------------------------
    Inputs:
    rawFolder:   Temp directory where images are transferred to from camera
    base:        Base directory for photos --> '/Users/chad/Pictures/testing'
    filename:    Old filename of raw file from camera --> 'DSC_0001.jpg'
    newName :    New filename as result of RenameFile --> 0000_yyyy-mm-dd_hh-mm-ss_00mm.jpg
    y:           Year from DateTimeDigitized Exif tag
    m:           Month from DateTimeDigitized Exif tag
    d:           Day from DateTimeDigitized Exif tag
    --------------------------------------------------------------------------    
    """
    # Check for/make dirs for file to go into
    # If dir already exists, use it - if it doesn't exist, then create it
    try:
        if os.path.isdir(base + '/' + y) != 1:
            os.mkdir(base + '/' + y)
        if os.path.isdir(base + '/' + y + '/' + m) != 1:
            os.mkdir(base + '/' + y + '/' + m)
        if os.path.isdir(base + '/' + y + '/' + m + '/' + d) != 1:
            os.mkdir(base + '/' + y + '/' + m + '/' + d)
        # Copy file, renaming it with new filename
        shutil.copyfile(rawFolder + '/' + filename, base + '/' + y + '/' + m + '/' + d + '/' + newName)
        imageName = base + '/' + y + '/' + m + '/' + d + '/' + newName
    except:
        tb = sys.exc_info()[2]
        tbinfo = traceback.format_tb(tb)[0]
        pymsg = "PYTHON ERRORS:\nTraceback Info:\n" + tbinfo + "\nError Info:\n    " + \
                str(sys.exc_type)+ ": " + str(sys.exc_value) + "\n"
    print 'New home: ', imageName, '\n'

    Files the input image according to date taken --> 2006/07/09
    /Users
      /Chad
        /Pictures
          /2006
            /07
              /09
                image goes here
    --------------------------------------------------------------------------
    Inputs:
    rawFolder:   Temp directory where images are transferred to from camera
    base:        Base directory for photos --> '/Users/chad/Pictures/testing'
    filename:    Old filename of raw file from camera --> 'DSC_0001.jpg'
    newName :    New filename as result of RenameFile --> 0000_yyyy-mm-dd_hh-mm-ss_00mm.jpg
    y:           Year from DateTimeDigitized Exif tag
    m:           Month from DateTimeDigitized Exif tag
    d:           Day from DateTimeDigitized Exif tag
    --------------------------------------------------------------------------    
    
recipes/Python/500266_Cataloging_adding_IPTC_keywords_digital/recipe-500266.py