Commit 0caae2a4 authored by Thom Wiggers's avatar Thom Wiggers 📐
Browse files

Merge branch 'comment-thumbnail-generation' into 'master'

utils/thumbnails: document thumbnail url usage

See merge request !435
parents b63243c0 fd94bb19
......@@ -31,6 +31,9 @@ def thumbnail(path, size, fit=True):
os.path.getmtime(full_path) > os.path.getmtime(full_thumbpath)):
pathuri = urlquote(path, safe=[''])
thumburi = urlquote(thumbpath, safe=[''])
# We provide a URL instead of calling it as a function, so that using
# it means kicking off a new GET request. If we would generate all
# thumbnails inline, loading an album overview would have high latency.
return reverse('generate-thumbnail',
args=[size_fit, pathuri, thumburi])
......@@ -41,4 +44,7 @@ def thumbnail(path, size, fit=True):
return settings.MEDIA_URL + thumbpath
# Otherwise simply place it in media/thumbnails.
# We provide a URL instead of calling it as a function, so that using
# it means kicking off a new GET request. If we would generate all
# thumbnails inline, loading an album overview would have high latency.
return reverse('private-thumbnails', args=[size_fit, path])
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment