rcube_image

Image resizer and converter

package

Framework

subpackage

Utils

Methods

Class constructor

__construct(string $filename) 

Arguments

$filename

string

Image file name/path

Convert image to a given type

convert(integer $type, string $filename = null) : boolean

Arguments

$type

integer

Destination file type (see class constants)

$filename

string

Output filename (if empty, original file will be used and filename extension will be modified)

Response

boolean

True on success, False on failure

ImageMagick based image properties read.

identify() 

Checks if image format conversion is supported

is_convertable( $mimetype = null) : boolean
static

Arguments

$mimetype

Response

boolean

True if specified format can be converted to another format

Check if we have enough memory to load specified image

mem_check( $props) 

Arguments

$props

Get image properties.

props() : mixed

Response

mixed

Hash array with image props like type, width, height

Resize image to a given size. Use only to shrink an image.

resize(integer $size, string $filename = null, boolean $browser_compat = false) : mixed

If an image is smaller than specified size it will be not resized.

Arguments

$size

integer

Max width/height size

$filename

string

Output filename

$browser_compat

boolean

Convert to image type displayable by any browser

Response

mixed

Output type on success, False on failure

Constants

TYPE_GIF

TYPE_GIF

TYPE_JPG

TYPE_JPG

TYPE_PNG

TYPE_PNG

TYPE_TIF

TYPE_TIF

Properties

image_file

image_file : 

Type(s)

extensions

extensions : 
static

Type(s)