mirror of
https://github.com/Hopiu/django-imagekit.git
synced 2026-05-28 22:08:17 +00:00
Extension argument to cache_to includes dot.
It seems that's how we do it in python world. Who am I to argue?
This commit is contained in:
parent
77459eae73
commit
3f7ca512af
1 changed files with 3 additions and 3 deletions
|
|
@ -80,11 +80,11 @@ class ImageSpec(_ImageSpecMixin):
|
||||||
def _get_suggested_extension(name, format):
|
def _get_suggested_extension(name, format):
|
||||||
if format:
|
if format:
|
||||||
# Try to look up an extension by the format
|
# Try to look up an extension by the format
|
||||||
extensions = [k.lstrip('.') for k, v in Image.EXTENSION.iteritems() \
|
extensions = [k for k, v in Image.EXTENSION.iteritems() \
|
||||||
if v == format.upper()]
|
if v == format.upper()]
|
||||||
else:
|
else:
|
||||||
extensions = []
|
extensions = []
|
||||||
original_extension = os.path.splitext(name)[1].lstrip('.')
|
original_extension = os.path.splitext(name)[1]
|
||||||
if not extensions or original_extension.lower() in extensions:
|
if not extensions or original_extension.lower() in extensions:
|
||||||
# If the original extension matches the format, use it.
|
# If the original extension matches the format, use it.
|
||||||
extension = original_extension
|
extension = original_extension
|
||||||
|
|
@ -189,7 +189,7 @@ class ImageSpecFile(object):
|
||||||
"""
|
"""
|
||||||
filepath, basename = os.path.split(path)
|
filepath, basename = os.path.split(path)
|
||||||
filename = os.path.splitext(basename)[0]
|
filename = os.path.splitext(basename)[0]
|
||||||
new_name = '{0}_{1}.{2}'.format(filename, specname, extension)
|
new_name = '{0}_{1}{2}'.format(filename, specname, extension)
|
||||||
return os.path.join(os.path.join('cache', filepath), new_name)
|
return os.path.join(os.path.join('cache', filepath), new_name)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue