Version 4.2.0

This commit is contained in:
Neo committed 2025-12-19 05:44:59 -08:00
1 parent 0dc2aee5ed
commit 96997ddd8e
2074 files changed
+125454 -55780

No files matched your search

+55 -9
View File
@@ -1,12 +1,11 @@
<?php
/**
* @brief Image Class
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @since 19 Feb 2013
* @version SVN_VERSION_NUMBER
*/
namespace IPS;
@@ -117,7 +116,6 @@ abstract class _Image
if( \IPS\Image::exifSupported() )
{
/* Differences in orientation between GD and ImageMagick can cause auto-reorient to not work properly */
/* @see http://community.invisionpower.com/4bugtrack/rc1-imagemagick-and-vertical-photos-r2952 */
$orientation = $obj->getImageOrientation();
if ( !( $obj instanceof Image\Imagemagick ) )
@@ -251,10 +249,10 @@ abstract class _Image
* @return void
*/
public function watermark( \IPS\Image $watermark )
{
{
/* If it's too big, resize the watermark */
$watermark->resizeToMax( $this->width, $this->height );
/* Impose */
$this->impose( $watermark, $this->width - $watermark->width, $this->height - $watermark->height );
}
@@ -332,7 +330,37 @@ abstract class _Image
$this->exif = $result;
}
/**
* Create a new blank canvas image
*
* @param int $width Width
* @param int $height Height
* @param array $rgb Color to use for bg
* @return \IPS\Image
*/
public static function newImageCanvas( $width, $height, $rgb )
{
if( \IPS\Settings::i()->image_suite == 'imagemagick' and class_exists( 'Imagick', FALSE ) )
{
return Image\Imagemagick::newImageCanvas( $width, $height, $rgb );
}
else
{
return Image\Gd::newImageCanvas( $width, $height, $rgb );
}
}
/**
* Write text on our image
*
* @param string $text Text
* @param string $font Path to font to use
* @param int $size Size of text
* @return void
*/
abstract public function write( $text, $font, $size );
/**
* Get Contents
*
@@ -401,4 +429,22 @@ abstract class _Image
* @return void
*/
abstract public function setImageOrientation( $orientation );
/**
* Can we write text reliably on an image?
*
* @return bool
*/
public static function canWriteText()
{
/* Create object */
if( \IPS\Settings::i()->image_suite == 'imagemagick' and class_exists( 'Imagick', FALSE ) )
{
return Image\Imagemagick::canWriteText();
}
else
{
return Image\Gd::canWriteText();
}
}
}