Version 4.5.0
This commit is contained in:
1 parent
1a0c7fd3c2
commit
f79dcf067a
3791 files changed
+248032
-76372
No files matched your search
@@ -11,7 +11,7 @@
|
||||
namespace IPS\Image;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
@@ -56,7 +56,7 @@ class _Imagemagick extends \IPS\Image
|
||||
$this->imagick = new \Imagick( $this->tempFile );
|
||||
|
||||
/* Set quality (if image format is JPEG) */
|
||||
if ( in_array( mb_strtolower( $this->imagick->getImageFormat() ), array( 'jpg', 'jpeg' ) ) )
|
||||
if ( \in_array( mb_strtolower( $this->imagick->getImageFormat() ), array( 'jpg', 'jpeg' ) ) )
|
||||
{
|
||||
$this->imagick->setImageCompressionQuality( (int) \IPS\Settings::i()->image_jpg_quality ?: 85 );
|
||||
}
|
||||
@@ -103,7 +103,7 @@ class _Imagemagick extends \IPS\Image
|
||||
|
||||
$this->imagick->stripImage();
|
||||
|
||||
if( count( $imageColorProfiles ) )
|
||||
if( \count( $imageColorProfiles ) )
|
||||
{
|
||||
foreach( $imageColorProfiles as $type => $profile )
|
||||
{
|
||||
@@ -247,6 +247,12 @@ class _Imagemagick extends \IPS\Image
|
||||
*/
|
||||
protected function setDimensions()
|
||||
{
|
||||
/* If this is a gif, we need to coalesce the image in order to get the proper dimensions */
|
||||
if ( mb_strtolower( $this->imagick->getImageFormat() ) === 'gif' )
|
||||
{
|
||||
$this->imagick = $this->imagick->coalesceImages();
|
||||
}
|
||||
|
||||
/* Set width/height */
|
||||
$this->width = $this->imagick->getImageWidth();
|
||||
$this->height = $this->imagick->getImageHeight();
|
||||
|
||||
Reference in new issue
Block a user