Version 4.1.19

This commit is contained in:
Neo committed 2025-12-19 05:38:56 -08:00
1 parent 28bd025b35
commit 2bd5025018
2674 files changed
+233518 -77766

No files matched your search

+25 -9
View File
@@ -2,9 +2,9 @@
/**
* @brief Image Class - ImageMagick
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @package IPS Community Suite
* @since 06 Mar 2014
* @version SVN_VERSION_NUMBER
*/
@@ -51,7 +51,13 @@ class _Imagemagick extends \IPS\Image
}
catch ( \ImagickException $e )
{
throw new \InvalidArgumentException;
throw new \InvalidArgumentException( $e->getMessage(), $e->getCode() );
}
/* Set quality (if image format is JPEG) */
if ( in_array( $this->imagick->getImageFormat(), array( 'jpg', 'jpeg' ) ) )
{
$this->imagick->setImageCompressionQuality( (int) \IPS\Settings::i()->image_jpg_quality ?: 85 );
}
/* Set width/height */
@@ -135,7 +141,22 @@ class _Imagemagick extends \IPS\Image
*/
public function cropToPoints( $point1X, $point1Y, $point2X, $point2Y )
{
$this->imagick->cropImage( $point2X - $point1X, $point2Y - $point1Y, $point1X, $point1Y );
if( mb_strtolower( $this->imagick->getImageFormat() ) === 'gif' )
{
$this->imagick = $this->imagick->coalesceImages();
foreach( $this->imagick as $frame )
{
$frame->cropImage( $point2X - $point1X, $point2Y - $point1Y, $point1X, $point1Y );
$frame->setImagePage($point2X - $point1X, $point2Y - $point1Y, 0, 0);
}
$this->imagick = $this->imagick->deconstructImages();
}
else
{
$this->imagick->cropImage( $point2X - $point1X, $point2Y - $point1Y, $point1X, $point1Y );
}
/* Set width/height */
$this->setDimensions();
@@ -180,11 +201,6 @@ class _Imagemagick extends \IPS\Image
$this->height = $this->imagick->getImageHeight();
}
/**
* Get Image Orientation
*
* @return int|NULL
*/
/**
* Get Image Orientation
*