Fix for images orientation in page content

This commit is contained in:
Flavio Copes
2015-12-21 19:10:19 +01:00
committed by Andy Miller
parent 593fd20a15
commit 9a8efdf9cd
2 changed files with 6 additions and 4 deletions

View File

@@ -278,6 +278,8 @@ trait ParsedownGravTrait
return $carry;
}, []);
$actions['fixOrientation'] = true;
// valid attributes supported
$valid_attributes = ['rel', 'target', 'id', 'class', 'classes'];
@@ -301,6 +303,9 @@ trait ParsedownGravTrait
}
$url['query']= http_build_query($actions, null, '&', PHP_QUERY_RFC3986);
} else {
$actions['fixOrientation'] = true;
$url['query']= http_build_query($actions, null, '&', PHP_QUERY_RFC3986);
}

View File

@@ -41,8 +41,7 @@ class ImageMedium extends Medium
public static $magic_actions = [
'resize', 'forceResize', 'cropResize', 'crop', 'zoomCrop',
'negate', 'brightness', 'contrast', 'grayscale', 'emboss',
'smooth', 'sharp', 'edge', 'colorize', 'sepia', 'enableProgressive',
'fixOrientation'
'smooth', 'sharp', 'edge', 'colorize', 'sepia', 'enableProgressive', 'fixOrientation'
];
/**
@@ -261,7 +260,6 @@ class ImageMedium extends Medium
if ($this->image) {
$this->image();
$this->image->clearOperations(); // Clear previously applied operations
$this->fixOrientation();
$this->filter();
}
@@ -471,7 +469,6 @@ class ImageMedium extends Medium
->setPrettyName(basename($this->get('basename')));
$this->filter();
$this->fixOrientation();
return $this;
}