all repos — nasg @ af50aef4b814d1e1139fb272cd9202d74583a139

panoramas are special, so treat them accordingly
Peter Molnar hello@petermolnar.eu
Wed, 13 Jun 2018 08:27:23 +0000
commit

af50aef4b814d1e1139fb272cd9202d74583a139

parent

7ea5788388164ae42281c83963ade57b8ea08ec8

2 files changed, 11 insertions(+), 3 deletions(-)

jump to
M nasg.pynasg.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.htmltemplates/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);