CI_Image_lib Class Reference

List of all members.

Public Member Functions

 CI_Image_lib ($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 >')

Public Attributes

 $image_library = 'gd2'
 $library_path = ''
 $dynamic_output = FALSE
 $source_image = ''
 $new_image = ''
 $width = ''
 $height = ''
 $quality = '90'
 $create_thumb = FALSE
 $thumb_marker = '_thumb'
 $maintain_ratio = TRUE
 $master_dim = 'auto'
 $rotation_angle = ''
 $x_axis = ''
 $y_axis = ''
 $wm_text = ''
 $wm_type = 'text'
 $wm_x_transp = 4
 $wm_y_transp = 4
 $wm_overlay_path = ''
 $wm_font_path = ''
 $wm_font_size = 17
 $wm_vrt_alignment = 'B'
 $wm_hor_alignment = 'C'
 $wm_padding = 0
 $wm_hor_offset = 0
 $wm_vrt_offset = 0
 $wm_font_color = '#ffffff'
 $wm_shadow_color = ''
 $wm_shadow_distance = 2
 $wm_opacity = 50
 $source_folder = ''
 $dest_folder = ''
 $mime_type = ''
 $orig_width = ''
 $orig_height = ''
 $image_type = ''
 $size_str = ''
 $full_src_path = ''
 $full_dst_path = ''
 $create_fnc = 'imagecreatetruecolor'
 $copy_fnc = 'imagecopyresampled'
 $error_msg = array()
 $wm_use_drop_shadow = FALSE
 $wm_use_truetype = FALSE


Member Function Documentation

CI_Image_lib::CI_Image_lib ( props = array()  ) 

Constructor

public

Parameters:
string 
Returns:
void

CI_Image_lib::clear (  ) 

Initialize image properties

Resets values in case this class is used in a loop

public

Returns:
void

CI_Image_lib::crop (  ) 

Image Crop

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

public

Returns:
bool

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

Show error messages

public

Parameters:
string 
Returns:
string

CI_Image_lib::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

Parameters:
array 
Returns:
array

CI_Image_lib::gd_loaded (  ) 

Is GD Installed?

public

Returns:
bool

CI_Image_lib::gd_version (  ) 

Get GD version

public

Returns:
mixed

CI_Image_lib::get_image_properties ( path = '',
return = FALSE 
)

Get image properties

A helper function that gets info about the file

public

Parameters:
string 
Returns:
mixed

CI_Image_lib::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

Parameters:
string 
Returns:
resource

CI_Image_lib::image_display_gd ( resource  ) 

Dynamically outputs an image

public

Parameters:
resource 
Returns:
void

CI_Image_lib::image_mirror_gd (  ) 

Create Mirror Image using GD

This function will flip horizontal or vertical

public

Returns:
bool

CI_Image_lib::image_process_gd ( action = 'resize'  ) 

Image Process Using GD/GD2

This function will resize or crop

public

Parameters:
string 
Returns:
bool

CI_Image_lib::image_process_imagemagick ( action = 'resize'  ) 

Image Process Using ImageMagick

This function will resize, crop or rotate

public

Parameters:
string 
Returns:
bool

CI_Image_lib::image_process_netpbm ( action = 'resize'  ) 

Image Process Using NetPBM

This function will resize, crop or rotate

public

Parameters:
string 
Returns:
bool

CI_Image_lib::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

Returns:
void

CI_Image_lib::image_rotate_gd (  ) 

Image Rotate Using GD

public

Returns:
bool

CI_Image_lib::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

Parameters:
resource 
Returns:
bool

CI_Image_lib::initialize ( props = array()  ) 

initialize image preferences

public

Parameters:
array 
Returns:
bool

CI_Image_lib::overlay_watermark (  ) 

Watermark - Graphic Version

public

Returns:
bool

CI_Image_lib::resize (  ) 

Image Resize

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

public

Returns:
bool

CI_Image_lib::rotate (  ) 

Image Rotate

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

public

Returns:
bool

CI_Image_lib::set_error ( msg  ) 

Set error message

public

Parameters:
string 
Returns:
void

CI_Image_lib::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

Parameters:
array 
Returns:
array

CI_Image_lib::text_watermark (  ) 

Watermark - Text Version

public

Returns:
bool

CI_Image_lib::watermark (  ) 

Image Watermark

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

public

Parameters:
string 
Returns:
bool


Member Data Documentation

CI_Image_lib::$copy_fnc = 'imagecopyresampled'

CI_Image_lib::$create_fnc = 'imagecreatetruecolor'

CI_Image_lib::$create_thumb = FALSE

CI_Image_lib::$dest_folder = ''

CI_Image_lib::$dynamic_output = FALSE

CI_Image_lib::$error_msg = array()

CI_Image_lib::$full_dst_path = ''

CI_Image_lib::$full_src_path = ''

CI_Image_lib::$height = ''

CI_Image_lib::$image_library = 'gd2'

CI_Image_lib::$image_type = ''

CI_Image_lib::$library_path = ''

CI_Image_lib::$maintain_ratio = TRUE

CI_Image_lib::$master_dim = 'auto'

CI_Image_lib::$mime_type = ''

CI_Image_lib::$new_image = ''

CI_Image_lib::$orig_height = ''

CI_Image_lib::$orig_width = ''

CI_Image_lib::$quality = '90'

CI_Image_lib::$rotation_angle = ''

CI_Image_lib::$size_str = ''

CI_Image_lib::$source_folder = ''

CI_Image_lib::$source_image = ''

CI_Image_lib::$thumb_marker = '_thumb'

CI_Image_lib::$width = ''

CI_Image_lib::$wm_font_color = '#ffffff'

CI_Image_lib::$wm_font_path = ''

CI_Image_lib::$wm_font_size = 17

CI_Image_lib::$wm_hor_alignment = 'C'

CI_Image_lib::$wm_hor_offset = 0

CI_Image_lib::$wm_opacity = 50

CI_Image_lib::$wm_overlay_path = ''

CI_Image_lib::$wm_padding = 0

CI_Image_lib::$wm_shadow_color = ''

CI_Image_lib::$wm_shadow_distance = 2

CI_Image_lib::$wm_text = ''

CI_Image_lib::$wm_type = 'text'

CI_Image_lib::$wm_use_drop_shadow = FALSE

CI_Image_lib::$wm_use_truetype = FALSE

CI_Image_lib::$wm_vrt_alignment = 'B'

CI_Image_lib::$wm_vrt_offset = 0

CI_Image_lib::$wm_x_transp = 4

CI_Image_lib::$wm_y_transp = 4

CI_Image_lib::$x_axis = ''

CI_Image_lib::$y_axis = ''


The documentation for this class was generated from the following file:

Generated on Sun Nov 16 16:09:15 2008 for CodeIgniter by  doxygen 1.5.7.1