mirror of
https://github.com/getgrav/grav.git
synced 2026-07-06 04:39:09 +02:00
moved fixOrientation() into ImageMediaTrait
Signed-off-by: Andy Miller <rhuk@mac.com>
This commit is contained in:
@@ -342,6 +342,12 @@ trait ImageMediaTrait
|
||||
->setActualCacheDir($cacheDir)
|
||||
->setPrettyName($this->getImagePrettyName());
|
||||
|
||||
// Fix orientation if enabled
|
||||
if (Grav::instance()['config']->get('system.images.auto_fix_orientation', false)) {
|
||||
$this->image->fixOrientation();
|
||||
}
|
||||
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
@@ -24,8 +24,6 @@ class ImageMedium extends Medium implements ImageMediaInterface, ImageManipulate
|
||||
use ImageMediaTrait;
|
||||
use ImageLoadingTrait;
|
||||
|
||||
protected static $orientationFixed;
|
||||
|
||||
/**
|
||||
* Construct.
|
||||
*
|
||||
@@ -91,7 +89,6 @@ class ImageMedium extends Medium implements ImageMediaInterface, ImageManipulate
|
||||
$this->medium_querystring = [];
|
||||
$this->filter();
|
||||
$this->clearAlternatives();
|
||||
static::$orientationFixed = null;
|
||||
}
|
||||
|
||||
$this->format = 'guess';
|
||||
@@ -279,16 +276,6 @@ class ImageMedium extends Medium implements ImageMediaInterface, ImageManipulate
|
||||
$this->image();
|
||||
}
|
||||
|
||||
// Fix orientation if enabled
|
||||
if (!isset(static::$orientationFixed)) {
|
||||
if (Grav::instance()['config']->get('system.images.auto_fix_orientation', false)) {
|
||||
$this->image->fixOrientation();
|
||||
static::$orientationFixed = true;
|
||||
} else {
|
||||
static::$orientationFixed = false;
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
$this->image->{$method}(...$args);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user