thumb: apply exif orientation
authorMischa POSLAWSKY <perl@shiar.org>
Mon, 16 Nov 2020 23:23:20 +0000 (00:23 +0100)
committerMischa POSLAWSKY <perl@shiar.org>
Sat, 5 Dec 2020 00:38:53 +0000 (01:38 +0100)
Match expected results (and modern browser rendering of originals)
for common rotation on phone submissions.

May not match photoswipe rendering, which depends on browser support.
Best to apply rotation without tags for now (exifautotran).

thumb/index.php

index d296fbf1560e0f4d339912fa7e9aa6f8c5f575b9..63812591820b30be0d43ec92c6baf420f6257d36 100644 (file)
@@ -90,6 +90,7 @@ function mkthumb_exec($source, $target, $width, $height)
                '-delete', '1--1', # static
                '-trim',
                '-background', 'white', '-layers', 'flatten', # opaque
+               '-auto-orient', # apply exif rotation
                '-interlace', 'plane', # progressive
                '-strip', '-taint', # omit metadata
                '-sampling-factor', '4:2:0', '-colorspace', 'sRGB', # half chroma