1
0
mirror of https://github.com/sjlongland/tornado-gallery.git synced 2025-09-14 00:53:19 +10:00

resizer: Avoid exposing full path, remove double extension

This commit is contained in:
Stuart Longland 2018-04-18 12:48:33 +10:00
parent 4919e2be7a
commit d0d6be6659
Signed by: stuartl
GPG Key ID: 6AA32EFB18079BAA

View File

@ -155,18 +155,17 @@ class ResizerPool(object):
orig_node = self._fs_node.join_node(gallery, photo)
# Determine the name of the cache file.
cache_name = self._cache_node.join(
('%(gallery)s-%(photo)s-'\
cache_name = ('%(gallery)s-%(photo)s-'\
'%(width)dx%(height)d-'\
'%(quality)d-%(rotation).6f.%(ext)s') % {
'gallery': gallery,
'photo': photo,
'photo': '.'.join(photo.split('.')[:-1]),
'width': width,
'height': height,
'quality': quality,
'rotation': rotation,
'ext': img_format.ext
})
}
log.debug('Resized file: %s', cache_name)
# Do we have this file?