Skip to content
Permalink
Browse files

Fix #2160

  • Loading branch information
ralsina committed Oct 31, 2015
1 parent cb3ad8a commit 8ef82c23ccdffbc2bff0b59c67f88801599b0a39
Showing with 17 additions and 7 deletions.
  1. +8 −0 CHANGES.txt
  2. +9 −7 nikola/plugins/task/galleries.py
@@ -1,3 +1,11 @@
New in Master
=============

Bugfixes
--------

* Don't examine all gallery image dates every build (Issue #2160)

New in v7.7.3
=============

@@ -194,13 +194,6 @@ def gen_tasks(self):
# Create image list, filter exclusions
image_list = self.get_image_list(gallery)

# Sort as needed
# Sort by date
if self.kw['sort_by_date']:
image_list.sort(key=lambda a: self.image_date(a))
else: # Sort by name
image_list.sort()

# Create thumbnails and large images in destination
for image in image_list:
for task in self.create_target_images(image, input_folder):
@@ -558,6 +551,15 @@ def url_from_path(p):
url = '/'.join(os.path.relpath(p, os.path.dirname(output_name) + os.sep).split(os.sep))
return url

all_data = list(zip(img_list, thumbs, img_titles))

if self.kw['sort_by_date']:
all_data.sort(key=lambda a: self.image_date(a[0]))
else: # Sort by name
all_data.sort(key=lambda a: a[0])

img_list, thumbs, img_titles = zip(*all_data)

photo_array = []
for img, thumb, title in zip(img_list, thumbs, img_titles):
w, h = _image_size_cache.get(thumb, (None, None))

0 comments on commit 8ef82c2

Please sign in to comment.
You can’t perform that action at this time.