mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-07 16:37:02 +03:00
Changes for #305
This commit is contained in:
parent
e53e21857e
commit
81392ee8a0
2 changed files with 6 additions and 5 deletions
|
|
@ -206,7 +206,9 @@ trait Raw
|
||||||
|
|
||||||
if (!$bDownload)
|
if (!$bDownload)
|
||||||
{
|
{
|
||||||
$bDetectImageOrientation = !!$self->Config()->Get('labs', 'detect_image_exif_orientation', false);
|
$bDetectImageOrientation = $self->Config()->Get('labs', 'image_exif_rotate', false)
|
||||||
|
// Mostly only JPEG has EXIF metadata
|
||||||
|
&& 'image/jpeg' == $sContentType;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if ($bThumbnail)
|
if ($bThumbnail)
|
||||||
|
|
@ -218,8 +220,7 @@ trait Raw
|
||||||
// $oImage->show('webp'); // Little Britain: "Safari says NO"
|
// $oImage->show('webp'); // Little Britain: "Safari says NO"
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
else if ($bDetectImageOrientation &&
|
else if ($bDetectImageOrientation)
|
||||||
\in_array($sContentType, array('image/png', 'image/jpeg', 'image/jpg', 'image/webp')))
|
|
||||||
{
|
{
|
||||||
$oImage = static::loadImage($rResource, $bDetectImageOrientation);
|
$oImage = static::loadImage($rResource, $bDetectImageOrientation);
|
||||||
\header('Content-Disposition: inline; '.
|
\header('Content-Disposition: inline; '.
|
||||||
|
|
@ -292,7 +293,7 @@ trait Raw
|
||||||
}, $sFolder, $iUid, $sMimeIndex);
|
}, $sFolder, $iUid, $sMimeIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static function loadImage($resource, bool $bDetectImageOrientation = true, int $iThumbnailBoxSize = 0) : \SnappyMail\Image
|
private static function loadImage($resource, bool $bDetectImageOrientation = false, int $iThumbnailBoxSize = 0) : \SnappyMail\Image
|
||||||
{
|
{
|
||||||
if (\extension_loaded('gmagick')) { $handler = 'gmagick'; }
|
if (\extension_loaded('gmagick')) { $handler = 'gmagick'; }
|
||||||
else if (\extension_loaded('imagick')) { $handler = 'imagick'; }
|
else if (\extension_loaded('imagick')) { $handler = 'imagick'; }
|
||||||
|
|
|
||||||
|
|
@ -382,7 +382,7 @@ Enables caching in the system'),
|
||||||
'fast_cache_redis_host' => array('127.0.0.1'),
|
'fast_cache_redis_host' => array('127.0.0.1'),
|
||||||
'fast_cache_redis_port' => array(6379),
|
'fast_cache_redis_port' => array(6379),
|
||||||
'use_local_proxy_for_external_images' => array(true),
|
'use_local_proxy_for_external_images' => array(true),
|
||||||
'detect_image_exif_orientation' => array(false),
|
'image_exif_rotate' => array(false),
|
||||||
'cookie_default_path' => array(''),
|
'cookie_default_path' => array(''),
|
||||||
'cookie_default_secure' => array(false),
|
'cookie_default_secure' => array(false),
|
||||||
'check_new_messages' => array(true),
|
'check_new_messages' => array(true),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue