From 746c313a8d5b9cf71bf8ef1e6d0df20be24db7f4 Mon Sep 17 00:00:00 2001 From: Alexandre Chataignon Date: Thu, 8 Dec 2016 05:38:33 +0100 Subject: [PATCH] Optimisation when using keep_orig --- sigal/gallery.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sigal/gallery.py b/sigal/gallery.py index 261531e..3b30fb1 100644 --- a/sigal/gallery.py +++ b/sigal/gallery.py @@ -101,8 +101,10 @@ class Media(UnicodeMixin): return self.filename orig_path = join(s['destination'], self.path, s['orig_dir']) check_or_create_dir(orig_path) - copy(self.src_path, join(orig_path, self.src_filename), - symlink=s['orig_link']) + big_path = join(orig_path, self.src_filename) + if not os.path.isfile(big_path): + copy(self.src_path, big_path, + symlink=s['orig_link']) return url_from_path(join(s['orig_dir'], self.src_filename)) @property