Properties

$image_library

$image_library : 

Type

$library_path

$library_path : 

Type

$dynamic_output

$dynamic_output : 

Type

$source_image

$source_image : 

Type

$new_image

$new_image : 

Type

$width

$width : 

Type

$height

$height : 

Type

$quality

$quality : 

Type

$create_thumb

$create_thumb : 

Type

$thumb_marker

$thumb_marker : 

Type

$maintain_ratio

$maintain_ratio : 

Type

$master_dim

$master_dim : 

Type

$rotation_angle

$rotation_angle : 

Type

$x_axis

$x_axis : 

Type

$y_axis

$y_axis : 

Type

$wm_text

$wm_text : 

Type

$wm_type

$wm_type : 

Type

$wm_x_transp

$wm_x_transp : 

Type

$wm_y_transp

$wm_y_transp : 

Type

$wm_overlay_path

$wm_overlay_path : 

Type

$wm_font_path

$wm_font_path : 

Type

$wm_font_size

$wm_font_size : 

Type

$wm_vrt_alignment

$wm_vrt_alignment : 

Type

$wm_hor_alignment

$wm_hor_alignment : 

Type

$wm_padding

$wm_padding : 

Type

$wm_hor_offset

$wm_hor_offset : 

Type

$wm_vrt_offset

$wm_vrt_offset : 

Type

$wm_font_color

$wm_font_color : 

Type

$wm_shadow_color

$wm_shadow_color : 

Type

$wm_shadow_distance

$wm_shadow_distance : 

Type

$wm_opacity

$wm_opacity : 

Type

$source_folder

$source_folder : 

Type

$dest_folder

$dest_folder : 

Type

$mime_type

$mime_type : 

Type

$orig_width

$orig_width : 

Type

$orig_height

$orig_height : 

Type

$image_type

$image_type : 

Type

$size_str

$size_str : 

Type

$full_src_path

$full_src_path : 

Type

$full_dst_path

$full_dst_path : 

Type

$create_fnc

$create_fnc : 

Type

$copy_fnc

$copy_fnc : 

Type

$error_msg

$error_msg : 

Type

$wm_use_drop_shadow

$wm_use_drop_shadow : 

Type

$wm_use_truetype

$wm_use_truetype : 

Type

Methods

__construct()

__construct(  $props = array()) : void

Constructor

Parameters

$props

clear()

clear() : void

Initialize image properties

Resets values in case this class is used in a loop

initialize()

initialize(  $props = array()) : boolean

initialize image preferences

Parameters

$props

Returns

boolean

resize()

resize() : boolean

Image Resize

This is a wrapper function that chooses the proper resize function based on the protocol specified

Returns

boolean

crop()

crop() : boolean

Image Crop

This is a wrapper function that chooses the proper cropping function based on the protocol specified

Returns

boolean

rotate()

rotate() : boolean

Image Rotate

This is a wrapper function that chooses the proper rotation function based on the protocol specified

Returns

boolean

image_process_gd()

image_process_gd(  $action = 'resize') : boolean

Image Process Using GD/GD2

This function will resize or crop

Parameters

$action

Returns

boolean

image_process_imagemagick()

image_process_imagemagick(  $action = 'resize') : boolean

Image Process Using ImageMagick

This function will resize, crop or rotate

Parameters

$action

Returns

boolean

image_process_netpbm()

image_process_netpbm(  $action = 'resize') : boolean

Image Process Using NetPBM

This function will resize, crop or rotate

Parameters

$action

Returns

boolean

image_rotate_gd()

image_rotate_gd() : boolean

Image Rotate Using GD

Returns

boolean

image_mirror_gd()

image_mirror_gd() : boolean

Create Mirror Image using GD

This function will flip horizontal or vertical

Returns

boolean

watermark()

watermark() : boolean

Image Watermark

This is a wrapper function that chooses the type of watermarking based on the specified preference.

Returns

boolean

overlay_watermark()

overlay_watermark() : boolean

Watermark - Graphic Version

Returns

boolean

text_watermark()

text_watermark() : boolean

Watermark - Text Version

Returns

boolean

image_create_gd()

image_create_gd(  $path = '',   $image_type = '') : resource

Create Image - GD

This simply creates an image resource handle based on the type of image being processed

Parameters

$path
$image_type

Returns

resource

image_save_gd()

image_save_gd(  $resource) : boolean

Write image file to disk - GD

Takes an image resource as input and writes the file to the specified destination

Parameters

$resource

Returns

boolean

image_display_gd()

image_display_gd(  $resource) : void

Dynamically outputs an image

Parameters

$resource

image_reproportion()

image_reproportion() : void

Re-proportion Image Width/Height

When creating thumbs, the desired width/height can end up warping the image due to an incorrect ratio between the full-sized image and the thumb.

This function lets us re-proportion the width/height if users choose to maintain the aspect ratio when resizing.

get_image_properties()

get_image_properties(  $path = '',   $return = FALSE) : mixed

Get image properties

A helper function that gets info about the file

Parameters

$path
$return

Returns

mixed

size_calculator()

size_calculator(  $vals) : array

Size calculator

This function takes a known width x height and recalculates it to a new size. Only one new variable needs to be known

$props = array( 'width' => $width, 'height' => $height, 'new_width' => 40, 'new_height' => '' );

Parameters

$vals

Returns

array

explode_name()

explode_name(  $source_image) : array

Explode source_image

This is a helper function that extracts the extension from the source_image. This function lets us deal with source_images with multiple periods, like: my.cool.jpg It returns an associative array with two elements: $array['ext'] = '.jpg'; $array['name'] = 'my.cool';

Parameters

$source_image

Returns

array

gd_loaded()

gd_loaded() : boolean

Is GD Installed?

Returns

boolean

gd_version()

gd_version() : mixed

Get GD version

Returns

mixed

set_error()

set_error(  $msg) : void

Set error message

Parameters

$msg

display_errors()

display_errors(  $open = '<p>',   $close = '</p>') : string

Show error messages

Parameters

$open
$close

Returns

string