Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fi #1605
  • Loading branch information
ralsina committed Sep 9, 2015
1 parent b0e9b64 commit 5b43e6b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGES.txt
Expand Up @@ -4,6 +4,7 @@ New in master
Features
--------

* Support SVG in galleries (Issue #1605)
* Allow inheriting templates with theme name (Issue #1814)
* Made TAG_PATH translatable (Issue #1914)
* Made CATEGORY_PATH translatable (Issue #1914)
Expand Down
2 changes: 1 addition & 1 deletion nikola/image_processing.py
Expand Up @@ -52,7 +52,7 @@ class ImageProcessor(object):

def resize_image(self, src, dst, max_size, bigger_panoramas=True):
"""Make a copy of the image in the requested size."""
if not Image:
if not Image or os.path.splitext(src)[1] in ['.svg', '.svgz']:
utils.copy_file(src, dst)
return
im = Image.open(src)
Expand Down
9 changes: 6 additions & 3 deletions nikola/plugins/task/galleries.py
Expand Up @@ -563,9 +563,12 @@ def url_from_path(p):
for img, thumb, title in zip(img_list, thumbs, img_titles):
w, h = _image_size_cache.get(thumb, (None, None))
if w is None:
im = Image.open(thumb)
w, h = im.size
_image_size_cache[thumb] = w, h
if os.path.splitext(thumb)[1] in ['.svg', '.svgz']:
w, h = 200, 200
else:
im = Image.open(thumb)
w, h = im.size
_image_size_cache[thumb] = w, h
# Thumbs are files in output, we need URLs
photo_array.append({
'url': url_from_path(img),
Expand Down

0 comments on commit 5b43e6b

Please sign in to comment.