def load_xmps(source_folder): temp_tweenpoints = [] all_xmps = [] files = [x for x in os.listdir(source_folder) if x.endswith('.xmp')] for filename in files: # # Get all xmps that have been changed, which will be used as keyframes # for tweening. # f = open(source_folder + '/' + filename) xmp_data = xmp.load(f) f.close() if xmp_data.haschanges(): temp_tweenpoints.append(xmp_data) all_xmps.append(xmp_data) sorted(all_xmps, key = lambda k: k.datetime) tweenpoints = map(lambda k: all_xmps.index(k), temp_tweenpoints) tweenpoints.extend((0, len(all_xmps) - 1)) tweenpoints = list(set(tweenpoints)) tweenpoints.sort() return tweenpoints, all_xmps
def load_xmps(source_folder): temp_tweenpoints = [] all_xmps = [] files = [x for x in os.listdir(source_folder) if x.endswith('.xmp')] for filename in files: # # Get all xmps that have been changed, which will be used as keyframes # for tweening. # f = open(source_folder + '/' + filename) xmp_data = xmp.load(f) f.close() if xmp_data.haschanges(): temp_tweenpoints.append(xmp_data) all_xmps.append(xmp_data) sorted(all_xmps, key=lambda k: k.datetime) tweenpoints = map(lambda k: all_xmps.index(k), temp_tweenpoints) tweenpoints.extend((0, len(all_xmps) - 1)) tweenpoints = list(set(tweenpoints)) tweenpoints.sort() return tweenpoints, all_xmps
import xmp folder = '/Users/zach/Pictures/2012/2012-06-05' files = [x for x in os.listdir(folder) if x.endswith('.xmp')] tweenpoints = [] corrections = {} shutters = set() apertures = set() for filename in files: f = open(folder + '/' + filename) xmp_data = xmp.load(f) f.close() filename, shutterspeed, fnumber, correction = xmp_data.shot_data() shutterspeed = eval(shutterspeed[1:-1] + '.0') fnumber = eval(fnumber[1:-1] + '.0') if shutterspeed not in corrections: corrections[shutterspeed] = {} if fnumber not in corrections[shutterspeed]: corrections[shutterspeed][fnumber] = set() if correction: corrections[shutterspeed][fnumber].add(correction)