Public Member Functions | |
__construct ($props=array()) | |
clear () | |
initialize ($props=array()) | |
resize () | |
crop () | |
rotate () | |
image_process_gd ($action= 'resize') | |
image_process_imagemagick ($action= 'resize') | |
image_process_netpbm ($action= 'resize') | |
image_rotate_gd () | |
image_mirror_gd () | |
watermark () | |
overlay_watermark () | |
text_watermark () | |
image_create_gd ($path= '', $image_type= '') | |
image_save_gd ($resource) | |
image_display_gd ($resource) | |
image_reproportion () | |
get_image_properties ($path= '', $return=FALSE) | |
size_calculator ($vals) | |
explode_name ($source_image) | |
gd_loaded () | |
gd_version () | |
set_error ($msg) | |
display_errors ($open= '< p >', $close= '</p >') | |
__construct | ( | $props = array() ) |
Constructor
string |
clear | ( | ) |
Initialize image properties
Resets values in case this class is used in a loop
public
crop | ( | ) |
Image Crop
This is a wrapper function that chooses the proper cropping function based on the protocol specified
public
display_errors | ( | $open = '<p>' , |
|
$close = '</p>' |
|||
) |
Show error messages
public
string |
explode_name | ( | $source_image) |
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';
public
array |
gd_loaded | ( | ) |
Is GD Installed?
public
gd_version | ( | ) |
Get GD version
public
get_image_properties | ( | $path = '' , |
|
$return = FALSE |
|||
) |
Get image properties
A helper function that gets info about the file
public
string |
image_create_gd | ( | $path = '' , |
|
$image_type = '' |
|||
) |
Create Image - GD
This simply creates an image resource handle based on the type of image being processed
public
string |
image_display_gd | ( | $resource) |
Dynamically outputs an image
public
resource |
image_mirror_gd | ( | ) |
Create Mirror Image using GD
This function will flip horizontal or vertical
public
image_process_gd | ( | $action = 'resize' ) |
Image Process Using GD/GD2
This function will resize or crop
public
string |
image_process_imagemagick | ( | $action = 'resize' ) |
Image Process Using ImageMagick
This function will resize, crop or rotate
public
string |
image_process_netpbm | ( | $action = 'resize' ) |
Image Process Using NetPBM
This function will resize, crop or rotate
public
string |
image_reproportion | ( | ) |
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.
public
image_rotate_gd | ( | ) |
Image Rotate Using GD
public
image_save_gd | ( | $resource) |
Write image file to disk - GD
Takes an image resource as input and writes the file to the specified destination
public
resource |
initialize | ( | $props = array() ) |
initialize image preferences
public
array |
overlay_watermark | ( | ) |
Watermark - Graphic Version
public
resize | ( | ) |
Image Resize
This is a wrapper function that chooses the proper resize function based on the protocol specified
public
rotate | ( | ) |
Image Rotate
This is a wrapper function that chooses the proper rotation function based on the protocol specified
public
set_error | ( | $msg) |
Set error message
public
string |
size_calculator | ( | $vals) |
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' => '' );
public
array |
text_watermark | ( | ) |
Watermark - Text Version
public
watermark | ( | ) |
Image Watermark
This is a wrapper function that chooses the type of watermarking based on the specified preference.
public
string |