Merge branch 'feature/exif-auto-fix-orientation' into develop

This commit is contained in:
Andy Miller
2015-12-21 21:13:09 -07:00
2 changed files with 6 additions and 5 deletions

View File

@@ -267,7 +267,8 @@ trait ParsedownGravTrait
// if this is a link
if (isset($excerpt['element']['attributes']['href'])) {
$url = parse_url(htmlspecialchars_decode($excerpt['element']['attributes']['href']));
$actions = [];
// if there is a query, then parse it and build action calls
if (isset($url['query'])) {
$actions = array_reduce(explode('&', $url['query']), function ($carry, $item) {
@@ -299,11 +300,11 @@ trait ParsedownGravTrait
}
}
}
$url['query']= http_build_query($actions, null, '&', PHP_QUERY_RFC3986);
}
$actions['fixOrientation'] = true;
$url['query']= http_build_query($actions, null, '&', PHP_QUERY_RFC3986);
// if no query elements left, unset query
if (empty($url['query'])) {
unset ($url['query']);

View File

@@ -41,7 +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'
'smooth', 'sharp', 'edge', 'colorize', 'sepia', 'enableProgressive', 'fixOrientation'
];
/**