diff --git a/pandora/item/timelines.py b/pandora/item/timelines.py index 4a7969f6..b9ce4e4d 100644 --- a/pandora/item/timelines.py +++ b/pandora/item/timelines.py @@ -176,8 +176,13 @@ def join_tiles(source_paths, target_path): cuts = [] offset = 0 for i, path in enumerate(source_paths): - with open(os.path.join(path, 'cuts.json'), 'r') as f: - path_cuts = json.load(f) + p = os.path.join(path, 'cuts.json') + if os.path.exists(p) + with open(p, 'r') as f: + path_cuts = json.load(f) + else: + print p, 'missing' + path_cuts = [] if i > 0: cuts.append(offset) for cut in path_cuts: diff --git a/pandora/item/views.py b/pandora/item/views.py index 6ce4c0a7..07add602 100644 --- a/pandora/item/views.py +++ b/pandora/item/views.py @@ -734,7 +734,7 @@ def timeline(request, id, size, position=-1, format='jpg', mode=None): path = timeline() while modes and not os.path.exists(path): - mode = modes.pop() + mode = modes.pop(0) path = timeline() return HttpFileResponse(path, content_type='image/jpeg')