Version 3.4.5

This commit is contained in:
Neo committed 2025-12-19 00:38:12 -08:00
1 parent fb6b5baabc
commit e4478369d8
1360 files changed
+228921 -179445

No files matched your search

+38 -9
View File
@@ -3,9 +3,9 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* IP.Board v3.4.5
* Image Handler: GD2 Library
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* Last Updated: $Date: 2013-02-06 19:48:42 -0500 (Wed, 06 Feb 2013) $
* </pre>
*
* @author $Author: bfarber $
@@ -15,7 +15,7 @@
* @subpackage Kernel
* @link http://www.invisionpower.com
* @since Monday 5th May 2008 14:00
* @version $Revision: 10914 $
* @version $Revision: 11951 $
*
* GD Example
* <code>
@@ -251,9 +251,9 @@ class classImageGd extends classImage implements interfaceImage
*/
public function resizeImage( $width, $height, $secondPass=false, $returnIfUnnecessary=false, $canvas=array() )
{
//---------------------------------------------------------
// Get proportionate dimensions and store
//---------------------------------------------------------
//---------------------------------------------------------
// Get proportionate dimensions and store
//---------------------------------------------------------
$dst_x = 0;
$dst_y = 0;
@@ -261,12 +261,22 @@ class classImageGd extends classImage implements interfaceImage
if ( ! $secondPass )
{
$new_dims = $this->_getResizeDimensions( $width, $height );
if( !$new_dims['img_width'] )
{
$new_dims = array(
'img_width' => $this->cur_dimensions['width'],
'img_height' => $this->cur_dimensions['height'],
'cur_width' => $this->cur_dimensions['width'],
'cur_height' => $this->cur_dimensions['height'],
);
}
/* Canvas? */
if ( is_array( $canvas ) && count( $canvas ) )
{
$storedNewDims = $new_dims;
$new_dims = array( 'img_width' => $canvas[0], 'img_height' => $canvas[1] );
$new_dims = array( 'img_width' => $canvas[0], 'img_height' => $canvas[1], 'cur_width' => $new_dims['cur_width'] ? $new_dims['cur_width'] : $this->cur_dimensions['width'], 'cur_height' => $new_dims['cur_height'] ? $new_dims['cur_height'] : $this->cur_dimensions['height'] );
if ( $storedNewDims['img_width'] < $canvas[0] )
{
@@ -284,7 +294,26 @@ class classImageGd extends classImage implements interfaceImage
$new_dims['img_width'] = $width;
$new_dims['img_height'] = $height;
}
//---------------------------------------------------------
// If new image is same size as original, just return original
// This preserves GIF animation and allows images not to be "compressed" unnecessarily
//---------------------------------------------------------
if ( $returnIfUnnecessary AND ! $this->force_resize )
{
if ( ( $this->orig_dimensions['width'] <= $width ) AND ( $this->orig_dimensions['height'] <= $height ) )
{
return array(
'originalWidth' => $this->orig_dimensions['width'],
'originalHeight' => $this->orig_dimensions['height'],
'newWidth' => $this->orig_dimensions['width'],
'newHeight' => $this->orig_dimensions['height'],
'noResize' => true
);
}
}
if( ! is_array($new_dims) OR !count($new_dims) OR !$new_dims['img_width'] )
{
if( ! $this->force_resize )
@@ -655,7 +684,7 @@ class classImageGd extends classImage implements interfaceImage
}
else
{
@imagecopymerge( $this->image, $mark, $locate_x, $locate_y, 0, 0, $img_info[0], $img_info[1], $opacity );
@imagecopymerge( $this->image, $mark, $locate_x, $locate_y, 0, 0, $img_info[0], $img_info[1], intval($opacity) );
}
//---------------------------------------------------------