1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-08 07:47:00 +02:00

Add @horst-n ImageSizer fixes for image orientation/rotation

This commit is contained in:
horst-n
2022-04-15 12:42:56 -04:00
committed by Ryan Cramer
parent f2b27cca75
commit b1457698c8
3 changed files with 12 additions and 12 deletions

View File

@@ -169,10 +169,10 @@ class ImageInspector extends WireData {
'2' => array(0, 1),
'3' => array(180, 0),
'4' => array(0, 2),
'5' => array(270, 1),
'6' => array(270, 0),
'7' => array(90, 1),
'8' => array(90, 0)
'5' => array(90, 1), // OLD: 270
'6' => array(90, 0), // OLD: 270
'7' => array(270, 1), // OLD: 90
'8' => array(270, 0) // OLD: 90
);
$result = array('orientation' => 0, 'rotate' => 0, 'flip' => 0);
$supportedExifMimeTypes = array('image/jpeg', 'image/tiff'); // hardcoded by PHP

View File

@@ -563,10 +563,10 @@ class ImageSizer extends Wire {
'2' => array(0, 1),
'3' => array(180, 0),
'4' => array(0, 2),
'5' => array(270, 1),
'6' => array(270, 0),
'7' => array(90, 1),
'8' => array(90, 0)
'5' => array(90, 1), // OLD: 270
'6' => array(90, 0), // OLD: 270
'7' => array(270, 1), // OLD: 90
'8' => array(270, 0) // OLD: 90
);
if(!function_exists('exif_read_data')) return null;
$exif = @exif_read_data($filename, 'IFD0');

View File

@@ -1533,10 +1533,10 @@ abstract class ImageSizerEngine extends WireData implements Module, Configurable
'2' => array(0, 1),
'3' => array(180, 0),
'4' => array(0, 2),
'5' => array(270, 1),
'6' => array(270, 0),
'7' => array(90, 1),
'8' => array(90, 0)
'5' => array(90, 1), // OLD: 270
'6' => array(90, 0), // OLD: 270
'7' => array(270, 1), // OLD: 90
'8' => array(270, 0) // OLD: 90
);
if(!isset($this->info['orientation']) || !isset($corrections[strval($this->info['orientation'])])) {