Version 4.3.0

This commit is contained in:
Neo committed 2025-12-19 05:47:12 -08:00
1 parent 96997ddd8e
commit fe1acf984a
1349 files changed
+116159 -67711

No files matched your search

+42 -45
View File
@@ -113,55 +113,52 @@ abstract class _Image
$obj->setExifData( $contents );
/* If the image is misoriented, attempt to automatically reorient */
if( \IPS\Image::exifSupported() )
{
/* Differences in orientation between GD and ImageMagick can cause auto-reorient to not work properly */
$orientation = $obj->getImageOrientation();
if ( !( $obj instanceof Image\Imagemagick ) )
{
switch ( $orientation )
{
case 3:
$obj->rotate( 180 );
$obj->hasBeenRotated = TRUE;
break;
case 6:
$obj->rotate( -90 );
$obj->hasBeenRotated = TRUE;
break;
$orientation = $obj->getImageOrientation();
case 8:
$obj->rotate( 90 );
$obj->hasBeenRotated = TRUE;
break;
}
}
else
/* Differences in orientation between GD and ImageMagick can cause auto-reorient to not work properly */
if ( !( $obj instanceof Image\Imagemagick ) )
{
switch ( $orientation )
{
switch( $orientation )
{
case 3:
$obj->rotate( 180 );
$obj->hasBeenRotated = TRUE;
break;
case 6:
$obj->rotate( 90 );
$obj->hasBeenRotated = TRUE;
break;
case 8:
$obj->rotate( -90 );
$obj->hasBeenRotated = TRUE;
break;
}
case 3:
$obj->rotate( 180 );
$obj->hasBeenRotated = TRUE;
break;
case 6:
$obj->rotate( -90 );
$obj->hasBeenRotated = TRUE;
break;
case 8:
$obj->rotate( 90 );
$obj->hasBeenRotated = TRUE;
break;
}
/* ImageMagick requires orientation be reset when rotated */
$obj->setImageOrientation( 1 );
}
else
{
switch( $orientation )
{
case 3:
$obj->rotate( 180 );
$obj->hasBeenRotated = TRUE;
break;
case 6:
$obj->rotate( 90 );
$obj->hasBeenRotated = TRUE;
break;
case 8:
$obj->rotate( -90 );
$obj->hasBeenRotated = TRUE;
break;
}
}
/* ImageMagick requires orientation be reset when rotated */
$obj->setImageOrientation( 1 );
}
/* Return */
+6 -6
View File
@@ -54,18 +54,18 @@ class _Imagemagick extends \IPS\Image
try
{
$this->imagick = new \Imagick( $this->tempFile );
/* Set quality (if image format is JPEG) */
if ( in_array( mb_strtolower( $this->imagick->getImageFormat() ), array( 'jpg', 'jpeg' ) ) )
{
$this->imagick->setImageCompressionQuality( (int) \IPS\Settings::i()->image_jpg_quality ?: 85 );
}
}
catch ( \ImagickException $e )
{
throw new \InvalidArgumentException( $e->getMessage(), $e->getCode() );
}
/* Set quality (if image format is JPEG) */
if ( in_array( mb_strtolower( $this->imagick->getImageFormat() ), array( 'jpg', 'jpeg' ) ) )
{
$this->imagick->setImageCompressionQuality( (int) \IPS\Settings::i()->image_jpg_quality ?: 85 );
}
/* Set width/height */
$this->setDimensions();
}