panoramas are special, so treat them accordingly
Peter Molnar hello@petermolnar.eu
Wed, 13 Jun 2018 08:27:23 +0000
2 files changed,
11 insertions(+),
3 deletions(-)
M
nasg.py
→
nasg.py
@@ -1167,7 +1167,15 @@
def _intermediate_dimension(self, size, width, height, crop=False): """ Calculate intermediate resize dimension and return a tuple of width, height """ size = int(size) - if (width > height and not crop) \ + if (width > height*3): + size = int(size * 0.6) + # panorama + if (height <= size): + h = height + else: + h = size + w = int(float(h / height) * width) + elif (width > height and not crop) \ or (width < height and crop): w = size h = int(float(size / width) * height)
M
templates/MagicPHP.html
→
templates/MagicPHP.html
@@ -58,13 +58,13 @@
$redirects = array( {% for (from, to) in redirects %} "{{ from }}" => "{{ to }}", -{% endfor %} +{%- endfor %} ); $gone = array( {% for gone in gones %} "{{ gone }}" => true, -{% endfor %} +{%- endfor %} ); $uri = filter_var($_SERVER['REQUEST_URI'], FILTER_SANITIZE_URL);