diff options
author | luxagraf <sng@luxagraf.net> | 2017-01-01 16:15:59 -0500 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2017-01-01 16:15:59 -0500 |
commit | 3a876c9382c6e617f6dfebc087cbd89154c8ce78 (patch) | |
tree | 043aeac62181f461711ef159f17097ed9c3f8479 /app | |
parent | a87323ebd04782a41e3e808f31f6b893b47f4610 (diff) |
fixed picful template
Diffstat (limited to 'app')
-rw-r--r-- | app/photos/templatetags/get_image_width.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/app/photos/templatetags/get_image_width.py b/app/photos/templatetags/get_image_width.py new file mode 100644 index 0000000..ac39184 --- /dev/null +++ b/app/photos/templatetags/get_image_width.py @@ -0,0 +1,9 @@ +from math import floor +from django import template + +register = template.Library() + +@register.simple_tag +def get_image_width(obj, size, *args): + ratio = floor(int(size)*100/int(obj.height))/100 + return floor(ratio*int(obj.height)) |