My Project
 All Data Structures Namespaces Functions Variables
Public Member Functions | Data Fields
CI_Image_lib Class Reference

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 >')
 

Data Fields

 $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
 

Constructor & Destructor Documentation

__construct (   $props = array())

Constructor

Parameters
string
Returns
void

Member Function Documentation

clear ( )

Initialize image properties

Resets values in case this class is used in a loop

public

Returns
void
crop ( )

Image Crop

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

public

Returns
bool
display_errors (   $open = '<p>',
  $close = '</p>' 
)

Show error messages

public

Parameters
string
Returns
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

Parameters
array
Returns
array
gd_loaded ( )

Is GD Installed?

public

Returns
bool
gd_version ( )

Get GD version

public

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

Get image properties

A helper function that gets info about the file

public

Parameters
string
Returns
mixed
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
image_display_gd (   $resource)

Dynamically outputs an image

public

Parameters
resource
Returns
void
image_mirror_gd ( )

Create Mirror Image using GD

This function will flip horizontal or vertical

public

Returns
bool
image_process_gd (   $action = 'resize')

Image Process Using GD/GD2

This function will resize or crop

public

Parameters
string
Returns
bool
image_process_imagemagick (   $action = 'resize')

Image Process Using ImageMagick

This function will resize, crop or rotate

public

Parameters
string
Returns
bool
image_process_netpbm (   $action = 'resize')

Image Process Using NetPBM

This function will resize, crop or rotate

public

Parameters
string
Returns
bool
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
image_rotate_gd ( )

Image Rotate Using GD

public

Returns
bool
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
initialize (   $props = array())

initialize image preferences

public

Parameters
array
Returns
bool
overlay_watermark ( )

Watermark - Graphic Version

public

Returns
bool
resize ( )

Image Resize

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

public

Returns
bool
rotate ( )

Image Rotate

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

public

Returns
bool
set_error (   $msg)

Set error message

public

Parameters
string
Returns
void
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
text_watermark ( )

Watermark - Text Version

public

Returns
bool
watermark ( )

Image Watermark

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

public

Parameters
string
Returns
bool

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