Version 4.7.8

This commit is contained in:
Neo committed 2025-12-19 16:10:42 -08:00
1 parent 7b7404e741
commit fd22d99e69
688 files changed
+19814 -10890

No files matched your search

+4 -3
View File
@@ -55,12 +55,13 @@ abstract class _Image
/**
* Create Object
*
* @param string $contents Contents
* @param string $contents Contents
* @param bool $checkRotation Check image to correct rotation
* @return \IPS\Image
* @throws \InvalidArgumentException
* @link https://en.wikipedia.org/wiki/List_of_file_signatures
*/
public static function create( $contents )
public static function create( string $contents, bool $checkRotation=TRUE )
{
/* Work out the type */
$imageType = NULL;
@@ -127,7 +128,7 @@ abstract class _Image
}
/* Set EXIF data immediately */
if( static::exifSupported() )
if( static::exifSupported() AND $checkRotation )
{
$obj->setExifData( $contents );
-29
View File
@@ -158,35 +158,6 @@ class _Imagemagick extends \IPS\Image
$this->setDimensions();
}
/**
* Resize to maximum
*
* @param int|NULL $maxWidth Max Width (in pixels) or NULL
* @param int|NULL $maxHeight Max Height (in pixels) or NULL
* @param bool $retainRatio If TRUE, the image will keep it's current width/height ratio rather than being squashed
* @return bool Returns TRUE if it actually resized, or FALSE if it wasn't necessary
*/
public function resizeToMax( $maxWidth=NULL, $maxHeight=NULL, $retainRatio=TRUE )
{
/* If we want to strip exif, we need to process this image regardless of size */
if( ! \IPS\Settings::i()->imagick_strip_exif )
{
return parent::resizeToMax( $maxWidth, $maxHeight, $retainRatio );
}
/* If the image is smaller, let's "resize" it keeping the same dimensions, so it runs via the __toString method */
if( ( $maxWidth == NULL or $this->width < $maxWidth ) and ( $maxHeight == NULL or $this->height < $maxHeight ) )
{
$this->resize( $this->width, $this->height );
return true;
}
else
{
return parent::resizeToMax( $maxWidth, $maxHeight, $retainRatio );
}
}
/**
* Crop to a given width and height (will attempt to downsize first)
*