Class ImageResize
PHP class to resize and scale images
public static
|
|
public
|
|
protected
|
|
public
|
|
public
|
|
public
static
|
|
public
string
|
#
getImageAsString( integer $image_type = null, integer $quality = null )
Convert the image to string |
public
string
|
|
public
|
|
public
static
|
#
resizeToShortSide( integer $max_short, boolean $allow_enlarge = false )
Resizes image according to the given short side (short side proportional) |
public
static
|
#
resizeToLongSide( integer $max_long, boolean $allow_enlarge = false )
Resizes image according to the given long side (short side proportional) |
public
static
|
#
resizeToHeight( integer $height, boolean $allow_enlarge = false )
Resizes image according to the given height (width proportional) |
public
static
|
#
resizeToWidth( integer $width, boolean $allow_enlarge = false )
Resizes image according to the given width (height proportional) |
public
static
|
#
resizeToBestFit( integer $max_width, integer $max_height, boolean $allow_enlarge = false )
Resizes image to best fit inside the given dimensions |
public
static
|
|
public
static
|
|
public
static
|
|
public
static
|
|
public
integer
|
|
public
integer
|
|
public
integer
|
|
public
integer
|
|
protected
float|integer
|
#
getCropPosition( integer $expectedSize, integer $position = self::CROPCENTER )
Gets crop position (X or Y) according to the given position |
public
null
|
integer |
CROPTOP
|
#
1
|
integer |
CROPCENTRE
|
#
2
|
integer |
CROPCENTER
|
#
2
|
integer |
CROPBOTTOM
|
#
3
|
integer |
CROPLEFT
|
#
4
|
integer |
CROPRIGHT
|
#
5
|
integer |
CROPTOPCENTER
|
#
6
|
integer |
IMG_FLIP_HORIZONTAL
|
#
0
|
integer |
IMG_FLIP_VERTICAL
|
#
1
|
integer |
IMG_FLIP_BOTH
|
#
2
|
public
integer
|
$quality_jpg
|
#
85
|
public
integer
|
$quality_webp
|
#
85
|
public
integer
|
$quality_png
|
#
6
|
public
boolean
|
$quality_truecolor
|
#
true
|
public
integer
|
$interlace
|
#
1
|
public
|
$source_type
|
|
protected
|
$source_image
|
|
protected
|
$original_w
|
|
protected
|
$original_h
|
|
protected
integer
|
$dest_x
|
#
0
|
protected
integer
|
$dest_y
|
#
0
|
protected
|
$source_x
|
|
protected
|
$source_y
|
|
protected
|
$dest_w
|
|
protected
|
$dest_h
|
|
protected
|
$source_w
|
|
protected
|
$source_h
|
|
protected
|
$source_info
|
|
protected
array
|
$filters
|
#
[]
|