Skip to content

Instantly share code, notes, and snippets.

View michitux's full-sized avatar

Michael Hamann michitux

View GitHub Profile
@michitux
michitux / rotate.patch
Created April 27, 2020 19:15
Patch to rotate resized images in DokuWiki based on EXIF orientation
--- a/inc/media.php 2018-12-28 17:46:14.000000000 +0100
+++ b/inc/media.php 2018-08-20 21:05:55.000000000 +0200
@@ -1084,6 +1084,15 @@
$w = (int) $info[0];
$h = (int) $info[1];
+ if ($meta) {
+ $orientation = media_getTag('Orientation', $meta);
+ if ($orientation == 3 || $orientation == 6) {
+ $tmp = $h;