Public Member Functions | |
| CI_Image_lib ($props=array()) | |
| Constructor. | |
| clear () | |
| Initialize image properties. | |
| initialize ($props=array()) | |
| initialize image preferences | |
| resize () | |
| Image Resize. | |
| crop () | |
| Image Crop. | |
| rotate () | |
| Image Rotate. | |
| image_process_gd ($action= 'resize') | |
| Image Process Using GD/GD2. | |
| image_process_imagemagick ($action= 'resize') | |
| Image Process Using ImageMagick. | |
| image_process_netpbm ($action= 'resize') | |
| Image Process Using NetPBM. | |
| image_rotate_gd () | |
| Image Rotate Using GD. | |
| image_mirror_gd () | |
| Create Mirror Image using GD. | |
| watermark () | |
| Image Watermark. | |
| overlay_watermark () | |
| Watermark - Graphic Version. | |
| text_watermark () | |
| Watermark - Text Version. | |
| image_create_gd ($path= '', $image_type= '') | |
| Create Image - GD. | |
| image_save_gd ($resource) | |
| Write image file to disk - GD. | |
| image_display_gd ($resource) | |
| Dynamically outputs an image. | |
| image_reproportion () | |
| Re-proportion Image Width/Height. | |
| get_image_properties ($path= '', $return=FALSE) | |
| Get image properties. | |
| size_calculator ($vals) | |
| Size calculator. | |
| explode_name ($source_image) | |
| Explode source_image. | |
| gd_loaded () | |
| Is GD Installed? | |
| gd_version () | |
| Get GD version. | |
| set_error ($msg) | |
| Set error message. | |
| display_errors ($open= '< p >', $close= '</p >') | |
| Show error messages. | |
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 | |
Definition at line 27 of file Image_lib.php.
| CI_Image_lib::CI_Image_lib | ( | $ | props = array() |
) |
Constructor.
public
| string |
Definition at line 86 of file Image_lib.php.
References initialize(), and log_message().
00087 { 00088 if (count($props) > 0) 00089 { 00090 $this->initialize($props); 00091 } 00092 00093 log_message('debug', "Image Lib Class Initialized"); 00094 }

| CI_Image_lib::clear | ( | ) |
Initialize image properties.
Resets values in case this class is used in a loop
public
Definition at line 106 of file Image_lib.php.
00107 { 00108 $props = array('source_folder', 'dest_folder', 'source_image', 'full_src_path', 'full_dst_path', 'new_image', 'image_type', 'size_str', 'quality', 'orig_width', 'orig_height', 'rotation_angle', 'x_axis', 'y_axis', 'create_fnc', 'copy_fnc', 'wm_overlay_path', 'wm_use_truetype', 'dynamic_output', 'wm_font_size', 'wm_text', 'wm_vrt_alignment', 'wm_hor_alignment', 'wm_padding', 'wm_hor_offset', 'wm_vrt_offset', 'wm_font_color', 'wm_use_drop_shadow', 'wm_shadow_color', 'wm_shadow_distance', 'wm_opacity'); 00109 00110 foreach ($props as $val) 00111 { 00112 $this->$val = ''; 00113 } 00114 00115 // special consideration for master_dim 00116 $this->master_dim = 'auto'; 00117 }
| CI_Image_lib::crop | ( | ) |
Image Crop.
This is a wrapper function that chooses the proper cropping function based on the protocol specified
public
Definition at line 372 of file Image_lib.php.
00373 { 00374 $protocol = 'image_process_'.$this->image_library; 00375 00376 if (eregi("gd2$", $protocol)) 00377 { 00378 $protocol = 'image_process_gd'; 00379 } 00380 00381 return $this->$protocol('crop'); 00382 }
| CI_Image_lib::display_errors | ( | $ | open = '<p>', |
|
| $ | close = '</p>' | |||
| ) |
Show error messages.
public
| string |
Definition at line 1531 of file Image_lib.php.
01532 { 01533 $str = ''; 01534 foreach ($this->error_msg as $val) 01535 { 01536 $str .= $open.$val.$close; 01537 } 01538 01539 return $str; 01540 }
| 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
| array |
Definition at line 1424 of file Image_lib.php.
References $source_image.
Referenced by initialize().
01425 { 01426 $x = explode('.', $source_image); 01427 $ret['ext'] = '.'.end($x); 01428 01429 $name = ''; 01430 01431 $ct = count($x)-1; 01432 01433 for ($i = 0; $i < $ct; $i++) 01434 { 01435 $name .= $x[$i]; 01436 01437 if ($i < ($ct - 1)) 01438 { 01439 $name .= '.'; 01440 } 01441 } 01442 01443 $ret['name'] = $name; 01444 01445 return $ret; 01446 }

| CI_Image_lib::gd_loaded | ( | ) |
Is GD Installed?
public
Definition at line 1456 of file Image_lib.php.
01457 { 01458 if ( ! extension_loaded('gd')) 01459 { 01460 if ( ! dl('gd.so')) 01461 { 01462 return FALSE; 01463 } 01464 } 01465 01466 return TRUE; 01467 }
| CI_Image_lib::gd_version | ( | ) |
Get GD version.
public
Definition at line 1477 of file Image_lib.php.
Referenced by image_process_gd().
01478 { 01479 if (function_exists('gd_info')) 01480 { 01481 $gd_version = @gd_info(); 01482 $gd_version = preg_replace("/\D/", "", $gd_version['GD Version']); 01483 01484 return $gd_version; 01485 } 01486 01487 return FALSE; 01488 }

| CI_Image_lib::get_image_properties | ( | $ | path = '', |
|
| $ | return = FALSE | |||
| ) |
Get image properties.
A helper function that gets info about the file
public
| string |
Definition at line 1318 of file Image_lib.php.
References set_error().
Referenced by initialize(), overlay_watermark(), and text_watermark().
01319 { 01320 // For now we require GD but we should 01321 // find a way to determine this using IM or NetPBM 01322 01323 if ($path == '') 01324 $path = $this->full_src_path; 01325 01326 if ( ! file_exists($path)) 01327 { 01328 $this->set_error('imglib_invalid_path'); 01329 return FALSE; 01330 } 01331 01332 $vals = @getimagesize($path); 01333 01334 $types = array(1 => 'gif', 2 => 'jpeg', 3 => 'png'); 01335 01336 $mime = (isset($types[$vals['2']])) ? 'image/'.$types[$vals['2']] : 'image/jpg'; 01337 01338 if ($return == TRUE) 01339 { 01340 $v['width'] = $vals['0']; 01341 $v['height'] = $vals['1']; 01342 $v['image_type'] = $vals['2']; 01343 $v['size_str'] = $vals['3']; 01344 $v['mime_type'] = $mime; 01345 01346 return $v; 01347 } 01348 01349 $this->orig_width = $vals['0']; 01350 $this->orig_height = $vals['1']; 01351 $this->image_type = $vals['2']; 01352 $this->size_str = $vals['3']; 01353 $this->mime_type = $mime; 01354 01355 return TRUE; 01356 }


| 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
| string |
Definition at line 1130 of file Image_lib.php.
References $image_type, and set_error().
Referenced by image_mirror_gd(), image_process_gd(), image_rotate_gd(), overlay_watermark(), and text_watermark().
01131 { 01132 if ($path == '') 01133 $path = $this->full_src_path; 01134 01135 if ($image_type == '') 01136 $image_type = $this->image_type; 01137 01138 01139 switch ($image_type) 01140 { 01141 case 1 : 01142 if ( ! function_exists('imagecreatefromgif')) 01143 { 01144 $this->set_error(array('imglib_unsupported_imagecreate', 'imglib_gif_not_supported')); 01145 return FALSE; 01146 } 01147 01148 return imagecreatefromgif($path); 01149 break; 01150 case 2 : 01151 if ( ! function_exists('imagecreatefromjpeg')) 01152 { 01153 $this->set_error(array('imglib_unsupported_imagecreate', 'imglib_jpg_not_supported')); 01154 return FALSE; 01155 } 01156 01157 return imagecreatefromjpeg($path); 01158 break; 01159 case 3 : 01160 if ( ! function_exists('imagecreatefrompng')) 01161 { 01162 $this->set_error(array('imglib_unsupported_imagecreate', 'imglib_png_not_supported')); 01163 return FALSE; 01164 } 01165 01166 return imagecreatefrompng($path); 01167 break; 01168 01169 } 01170 01171 $this->set_error(array('imglib_unsupported_imagecreate')); 01172 return FALSE; 01173 }


| CI_Image_lib::image_display_gd | ( | $ | resource | ) |
Dynamically outputs an image.
public
| resource |
Definition at line 1241 of file Image_lib.php.
Referenced by image_mirror_gd(), image_process_gd(), image_rotate_gd(), overlay_watermark(), and text_watermark().
01242 { 01243 header("Content-Disposition: filename={$this->source_image};"); 01244 header("Content-Type: {$this->mime_type}"); 01245 header('Content-Transfer-Encoding: binary'); 01246 header('Last-Modified: '.gmdate('D, d M Y H:i:s', time()).' GMT'); 01247 01248 switch ($this->image_type) 01249 { 01250 case 1 : imagegif($resource); 01251 break; 01252 case 2 : imagejpeg($resource, '', $this->quality); 01253 break; 01254 case 3 : imagepng($resource); 01255 break; 01256 default : echo 'Unable to display the image'; 01257 break; 01258 } 01259 }

| CI_Image_lib::image_mirror_gd | ( | ) |
Create Mirror Image using GD.
This function will flip horizontal or vertical
public
Definition at line 767 of file Image_lib.php.
References $height, $width, image_create_gd(), image_display_gd(), and image_save_gd().
Referenced by rotate().
00768 { 00769 if ( ! $src_img = $this->image_create_gd()) 00770 { 00771 return FALSE; 00772 } 00773 00774 $width = $this->orig_width; 00775 $height = $this->orig_height; 00776 00777 if ($this->rotation_angle == 'hor') 00778 { 00779 for ($i = 0; $i < $height; $i++) 00780 { 00781 $left = 0; 00782 $right = $width-1; 00783 00784 while ($left < $right) 00785 { 00786 $cl = imagecolorat($src_img, $left, $i); 00787 $cr = imagecolorat($src_img, $right, $i); 00788 00789 imagesetpixel($src_img, $left, $i, $cr); 00790 imagesetpixel($src_img, $right, $i, $cl); 00791 00792 $left++; 00793 $right--; 00794 } 00795 } 00796 } 00797 else 00798 { 00799 for ($i = 0; $i < $width; $i++) 00800 { 00801 $top = 0; 00802 $bot = $height-1; 00803 00804 while ($top < $bot) 00805 { 00806 $ct = imagecolorat($src_img, $i, $top); 00807 $cb = imagecolorat($src_img, $i, $bot); 00808 00809 imagesetpixel($src_img, $i, $top, $cb); 00810 imagesetpixel($src_img, $i, $bot, $ct); 00811 00812 $top++; 00813 $bot--; 00814 } 00815 } 00816 } 00817 00818 // Show the image 00819 if ($this->dynamic_output == TRUE) 00820 { 00821 $this->image_display_gd($src_img); 00822 } 00823 else 00824 { 00825 // Or save it 00826 if ( ! $this->image_save_gd($src_img)) 00827 { 00828 return FALSE; 00829 } 00830 } 00831 00832 // Kill the file handles 00833 imagedestroy($src_img); 00834 00835 // Set the file to 777 00836 @chmod($this->full_dst_path, DIR_WRITE_MODE); 00837 00838 return TRUE; 00839 }


| CI_Image_lib::image_process_gd | ( | $ | action = 'resize' |
) |
Image Process Using GD/GD2.
This function will resize or crop
public
| string |
Definition at line 448 of file Image_lib.php.
References gd_version(), image_create_gd(), image_display_gd(), and image_save_gd().
00449 { 00450 $v2_override = FALSE; 00451 00452 // If the target width/height match the source, AND if the new file name is not equal to the old file name 00453 // we'll simply make a copy of the original with the new name... assuming dynamic rendering is off. 00454 if ($this->dynamic_output === FALSE) 00455 { 00456 if ($this->orig_width == $this->width AND $this->orig_height == $this->height) 00457 { 00458 if ($this->source_image != $this->new_image) 00459 { 00460 if (@copy($this->full_src_path, $this->full_dst_path)) 00461 { 00462 @chmod($this->full_dst_path, DIR_WRITE_MODE); 00463 } 00464 } 00465 00466 return TRUE; 00467 } 00468 } 00469 00470 // Let's set up our values based on the action 00471 if ($action == 'crop') 00472 { 00473 // Reassign the source width/height if cropping 00474 $this->orig_width = $this->width; 00475 $this->orig_height = $this->height; 00476 00477 // GD 2.0 has a cropping bug so we'll test for it 00478 if ($this->gd_version() !== FALSE) 00479 { 00480 $gd_version = str_replace('0', '', $this->gd_version()); 00481 $v2_override = ($gd_version == 2) ? TRUE : FALSE; 00482 } 00483 } 00484 else 00485 { 00486 // If resizing the x/y axis must be zero 00487 $this->x_axis = 0; 00488 $this->y_axis = 0; 00489 } 00490 00491 // Create the image handle 00492 if ( ! ($src_img = $this->image_create_gd())) 00493 { 00494 return FALSE; 00495 } 00496 00497 // Create The Image 00498 // 00499 // old conditional which users report cause problems with shared GD libs who report themselves as "2.0 or greater" 00500 // it appears that this is no longer the issue that it was in 2004, so we've removed it, retaining it in the comment 00501 // below should that ever prove inaccurate. 00502 // 00503 // if ($this->image_library == 'gd2' AND function_exists('imagecreatetruecolor') AND $v2_override == FALSE) 00504 if ($this->image_library == 'gd2' AND function_exists('imagecreatetruecolor')) 00505 { 00506 $create = 'imagecreatetruecolor'; 00507 $copy = 'imagecopyresampled'; 00508 } 00509 else 00510 { 00511 $create = 'imagecreate'; 00512 $copy = 'imagecopyresized'; 00513 } 00514 00515 $dst_img = $create($this->width, $this->height); 00516 $copy($dst_img, $src_img, 0, 0, $this->x_axis, $this->y_axis, $this->width, $this->height, $this->orig_width, $this->orig_height); 00517 00518 // Show the image 00519 if ($this->dynamic_output == TRUE) 00520 { 00521 $this->image_display_gd($dst_img); 00522 } 00523 else 00524 { 00525 // Or save it 00526 if ( ! $this->image_save_gd($dst_img)) 00527 { 00528 return FALSE; 00529 } 00530 } 00531 00532 // Kill the file handles 00533 imagedestroy($dst_img); 00534 imagedestroy($src_img); 00535 00536 // Set the file to 777 00537 @chmod($this->full_dst_path, DIR_WRITE_MODE); 00538 00539 return TRUE; 00540 }

| CI_Image_lib::image_process_imagemagick | ( | $ | action = 'resize' |
) |
Image Process Using ImageMagick.
This function will resize, crop or rotate
public
| string |
Definition at line 553 of file Image_lib.php.
References set_error().
00554 { 00555 // Do we have a vaild library path? 00556 if ($this->library_path == '') 00557 { 00558 $this->set_error('imglib_libpath_invalid'); 00559 return FALSE; 00560 } 00561 00562 if ( ! eregi("convert$", $this->library_path)) 00563 { 00564 if ( ! eregi("/$", $this->library_path)) $this->library_path .= "/"; 00565 00566 $this->library_path .= 'convert'; 00567 } 00568 00569 // Execute the command 00570 $cmd = $this->library_path." -quality ".$this->quality; 00571 00572 if ($action == 'crop') 00573 { 00574 $cmd .= " -crop ".$this->width."x".$this->height."+".$this->x_axis."+".$this->y_axis." \"$this->full_src_path\" \"$this->full_dst_path\" 2>&1"; 00575 } 00576 elseif ($action == 'rotate') 00577 { 00578 switch ($this->rotation_angle) 00579 { 00580 case 'hor' : $angle = '-flop'; 00581 break; 00582 case 'vrt' : $angle = '-flip'; 00583 break; 00584 default : $angle = '-rotate '.$this->rotation_angle; 00585 break; 00586 } 00587 00588 $cmd .= " ".$angle." \"$this->full_src_path\" \"$this->full_dst_path\" 2>&1"; 00589 } 00590 else // Resize 00591 { 00592 $cmd .= " -resize ".$this->width."x".$this->height." \"$this->full_src_path\" \"$this->full_dst_path\" 2>&1"; 00593 } 00594 00595 $retval = 1; 00596 00597 @exec($cmd, $output, $retval); 00598 00599 // Did it work? 00600 if ($retval > 0) 00601 { 00602 $this->set_error('imglib_image_process_failed'); 00603 return FALSE; 00604 } 00605 00606 // Set the file to 777 00607 @chmod($this->full_dst_path, DIR_WRITE_MODE); 00608 00609 return TRUE; 00610 }

| CI_Image_lib::image_process_netpbm | ( | $ | action = 'resize' |
) |
Image Process Using NetPBM.
This function will resize, crop or rotate
public
| string |
Definition at line 623 of file Image_lib.php.
References set_error().
00624 { 00625 if ($this->library_path == '') 00626 { 00627 $this->set_error('imglib_libpath_invalid'); 00628 return FALSE; 00629 } 00630 00631 // Build the resizing command 00632 switch ($this->image_type) 00633 { 00634 case 1 : 00635 $cmd_in = 'giftopnm'; 00636 $cmd_out = 'ppmtogif'; 00637 break; 00638 case 2 : 00639 $cmd_in = 'jpegtopnm'; 00640 $cmd_out = 'ppmtojpeg'; 00641 break; 00642 case 3 : 00643 $cmd_in = 'pngtopnm'; 00644 $cmd_out = 'ppmtopng'; 00645 break; 00646 } 00647 00648 if ($action == 'crop') 00649 { 00650 $cmd_inner = 'pnmcut -left '.$this->x_axis.' -top '.$this->y_axis.' -width '.$this->width.' -height '.$this->height; 00651 } 00652 elseif ($action == 'rotate') 00653 { 00654 switch ($this->rotation_angle) 00655 { 00656 case 90 : $angle = 'r270'; 00657 break; 00658 case 180 : $angle = 'r180'; 00659 break; 00660 case 270 : $angle = 'r90'; 00661 break; 00662 case 'vrt' : $angle = 'tb'; 00663 break; 00664 case 'hor' : $angle = 'lr'; 00665 break; 00666 } 00667 00668 $cmd_inner = 'pnmflip -'.$angle.' '; 00669 } 00670 else // Resize 00671 { 00672 $cmd_inner = 'pnmscale -xysize '.$this->width.' '.$this->height; 00673 } 00674 00675 $cmd = $this->library_path.$cmd_in.' '.$this->full_src_path.' | '.$cmd_inner.' | '.$cmd_out.' > '.$this->dest_folder.'netpbm.tmp'; 00676 00677 $retval = 1; 00678 00679 @exec($cmd, $output, $retval); 00680 00681 // Did it work? 00682 if ($retval > 0) 00683 { 00684 $this->set_error('imglib_image_process_failed'); 00685 return FALSE; 00686 } 00687 00688 // With NetPBM we have to create a temporary image. 00689 // If you try manipulating the original it fails so 00690 // we have to rename the temp file. 00691 copy ($this->dest_folder.'netpbm.tmp', $this->full_dst_path); 00692 unlink ($this->dest_folder.'netpbm.tmp'); 00693 @chmod($this->full_dst_path, DIR_WRITE_MODE); 00694 00695 return TRUE; 00696 }

| 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
Definition at line 1276 of file Image_lib.php.
Referenced by initialize().
01277 { 01278 if ( ! is_numeric($this->width) OR ! is_numeric($this->height) OR $this->width == 0 OR $this->height == 0) 01279 return; 01280 01281 if ( ! is_numeric($this->orig_width) OR ! is_numeric($this->orig_height) OR $this->orig_width == 0 OR $this->orig_height == 0) 01282 return; 01283 01284 $new_width = ceil($this->orig_width*$this->height/$this->orig_height); 01285 $new_height = ceil($this->width*$this->orig_height/$this->orig_width); 01286 01287 $ratio = (($this->orig_height/$this->orig_width) - ($this->height/$this->width)); 01288 01289 if ($this->master_dim != 'width' AND $this->master_dim != 'height') 01290 { 01291 $this->master_dim = ($ratio < 0) ? 'width' : 'height'; 01292 } 01293 01294 if (($this->width != $new_width) AND ($this->height != $new_height)) 01295 { 01296 if ($this->master_dim == 'height') 01297 { 01298 $this->width = $new_width; 01299 } 01300 else 01301 { 01302 $this->height = $new_height; 01303 } 01304 } 01305 }

| CI_Image_lib::image_rotate_gd | ( | ) |
Image Rotate Using GD.
public
Definition at line 706 of file Image_lib.php.
References image_create_gd(), image_display_gd(), image_save_gd(), and set_error().
Referenced by rotate().
00707 { 00708 // Is Image Rotation Supported? 00709 // this function is only supported as of PHP 4.3 00710 if ( ! function_exists('imagerotate')) 00711 { 00712 $this->set_error('imglib_rotate_unsupported'); 00713 return FALSE; 00714 } 00715 00716 // Create the image handle 00717 if ( ! ($src_img = $this->image_create_gd())) 00718 { 00719 return FALSE; 00720 } 00721 00722 // Set the background color 00723 // This won't work with transparent PNG files so we are 00724 // going to have to figure out how to determine the color 00725 // of the alpha channel in a future release. 00726 00727 $white = imagecolorallocate($src_img, 255, 255, 255); 00728 00729 // Rotate it! 00730 $dst_img = imagerotate($src_img, $this->rotation_angle, $white); 00731 00732 // Save the Image 00733 if ($this->dynamic_output == TRUE) 00734 { 00735 $this->image_display_gd($dst_img); 00736 } 00737 else 00738 { 00739 // Or save it 00740 if ( ! $this->image_save_gd($dst_img)) 00741 { 00742 return FALSE; 00743 } 00744 } 00745 00746 // Kill the file handles 00747 imagedestroy($dst_img); 00748 imagedestroy($src_img); 00749 00750 // Set the file to 777 00751 00752 @chmod($this->full_dst_path, DIR_WRITE_MODE); 00753 00754 return true; 00755 }


| 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
| resource |
Definition at line 1187 of file Image_lib.php.
References set_error().
Referenced by image_mirror_gd(), image_process_gd(), image_rotate_gd(), overlay_watermark(), and text_watermark().
01188 { 01189 switch ($this->image_type) 01190 { 01191 case 1 : 01192 if ( ! function_exists('imagegif')) 01193 { 01194 $this->set_error(array('imglib_unsupported_imagecreate', 'imglib_gif_not_supported')); 01195 return FALSE; 01196 } 01197 01198 @imagegif($resource, $this->full_dst_path); 01199 break; 01200 case 2 : 01201 if ( ! function_exists('imagejpeg')) 01202 { 01203 $this->set_error(array('imglib_unsupported_imagecreate', 'imglib_jpg_not_supported')); 01204 return FALSE; 01205 } 01206 01207 if (phpversion() == '4.4.1') 01208 { 01209 @touch($this->full_dst_path); // PHP 4.4.1 bug #35060 - workaround 01210 } 01211 01212 @imagejpeg($resource, $this->full_dst_path, $this->quality); 01213 break; 01214 case 3 : 01215 if ( ! function_exists('imagepng')) 01216 { 01217 $this->set_error(array('imglib_unsupported_imagecreate', 'imglib_png_not_supported')); 01218 return FALSE; 01219 } 01220 01221 @imagepng($resource, $this->full_dst_path); 01222 break; 01223 default : 01224 $this->set_error(array('imglib_unsupported_imagecreate')); 01225 return FALSE; 01226 break; 01227 } 01228 01229 return TRUE; 01230 }


| CI_Image_lib::initialize | ( | $ | props = array() |
) |
initialize image preferences
public
| array |
Definition at line 128 of file Image_lib.php.
References explode_name(), get_image_properties(), image_reproportion(), and set_error().
Referenced by CI_Image_lib().
00129 { 00130 /* 00131 * Convert array elements into class variables 00132 */ 00133 if (count($props) > 0) 00134 { 00135 foreach ($props as $key => $val) 00136 { 00137 $this->$key = $val; 00138 } 00139 } 00140 00141 /* 00142 * Is there a source image? 00143 * 00144 * If not, there's no reason to continue 00145 * 00146 */ 00147 if ($this->source_image == '') 00148 { 00149 $this->set_error('imglib_source_image_required'); 00150 return FALSE; 00151 } 00152 00153 /* 00154 * Is getimagesize() Available? 00155 * 00156 * We use it to determine the image properties (width/height). 00157 * Note: We need to figure out how to determine image 00158 * properties using ImageMagick and NetPBM 00159 * 00160 */ 00161 if ( ! function_exists('getimagesize')) 00162 { 00163 $this->set_error('imglib_gd_required_for_props'); 00164 return FALSE; 00165 } 00166 00167 $this->image_library = strtolower($this->image_library); 00168 00169 /* 00170 * Set the full server path 00171 * 00172 * The source image may or may not contain a path. 00173 * Either way, we'll try use realpath to generate the 00174 * full server path in order to more reliably read it. 00175 * 00176 */ 00177 if (function_exists('realpath') AND @realpath($this->source_image) !== FALSE) 00178 { 00179 $full_source_path = str_replace("\\", "/", realpath($this->source_image)); 00180 } 00181 else 00182 { 00183 $full_source_path = $this->source_image; 00184 } 00185 00186 $x = explode('/', $full_source_path); 00187 $this->source_image = end($x); 00188 $this->source_folder = str_replace($this->source_image, '', $full_source_path); 00189 00190 // Set the Image Properties 00191 if ( ! $this->get_image_properties($this->source_folder.$this->source_image)) 00192 { 00193 return FALSE; 00194 } 00195 00196 /* 00197 * Assign the "new" image name/path 00198 * 00199 * If the user has set a "new_image" name it means 00200 * we are making a copy of the source image. If not 00201 * it means we are altering the original. We'll 00202 * set the destination filename and path accordingly. 00203 * 00204 */ 00205 if ($this->new_image == '') 00206 { 00207 $this->dest_image = $this->source_image; 00208 $this->dest_folder = $this->source_folder; 00209 } 00210 else 00211 { 00212 if (strpos($this->new_image, '/') === FALSE) 00213 { 00214 $this->dest_folder = $this->source_folder; 00215 $this->dest_image = $this->new_image; 00216 } 00217 else 00218 { 00219 if (function_exists('realpath') AND @realpath($this->new_image) !== FALSE) 00220 { 00221 $full_dest_path = str_replace("\\", "/", realpath($this->new_image)); 00222 } 00223 else 00224 { 00225 $full_dest_path = $this->new_image; 00226 } 00227 00228 // Is there a file name? 00229 if ( ! preg_match("#\.(jpg|jpeg|gif|png)$#i", $full_dest_path)) 00230 { 00231 $this->dest_folder = $full_dest_path.'/'; 00232 $this->dest_image = $this->source_image; 00233 } 00234 else 00235 { 00236 $x = explode('/', $full_dest_path); 00237 $this->dest_image = end($x); 00238 $this->dest_folder = str_replace($this->dest_image, '', $full_dest_path); 00239 } 00240 } 00241 } 00242 00243 /* 00244 * Compile the finalized filenames/paths 00245 * 00246 * We'll create two master strings containing the 00247 * full server path to the source image and the 00248 * full server path to the destination image. 00249 * We'll also split the destination image name 00250 * so we can insert the thumbnail marker if needed. 00251 * 00252 */ 00253 if ($this->create_thumb === FALSE OR $this->thumb_marker == '') 00254 { 00255 $this->thumb_marker = ''; 00256 } 00257 00258 $xp = $this->explode_name($this->dest_image); 00259 00260 $filename = $xp['name']; 00261 $file_ext = $xp['ext']; 00262 00263 $this->full_src_path = $this->source_folder.$this->source_image; 00264 $this->full_dst_path = $this->dest_folder.$filename.$this->thumb_marker.$file_ext; 00265 00266 /* 00267 * Should we maintain image proportions? 00268 * 00269 * When creating thumbs or copies, the target width/height 00270 * might not be in correct proportion with the source 00271 * image's width/height. We'll recalculate it here. 00272 * 00273 */ 00274 if ($this->maintain_ratio === TRUE && ($this->width != '' AND $this->height != '')) 00275 { 00276 $this->image_reproportion(); 00277 } 00278 00279 /* 00280 * Was a width and height specified? 00281 * 00282 * If the destination width/height was 00283 * not submitted we will use the values 00284 * from the actual file 00285 * 00286 */ 00287 if ($this->width == '') 00288 $this->width = $this->orig_width; 00289 00290 if ($this->height == '') 00291 $this->height = $this->orig_height; 00292 00293 // Set the quality 00294 $this->quality = trim(str_replace("%", "", $this->quality)); 00295 00296 if ($this->quality == '' OR $this->quality == 0 OR ! is_numeric($this->quality)) 00297 $this->quality = 90; 00298 00299 // Set the x/y coordinates 00300 $this->x_axis = ($this->x_axis == '' OR ! is_numeric($this->x_axis)) ? 0 : $this->x_axis; 00301 $this->y_axis = ($this->y_axis == '' OR ! is_numeric($this->y_axis)) ? 0 : $this->y_axis; 00302 00303 // Watermark-related Stuff... 00304 if ($this->wm_font_color != '') 00305 { 00306 if (strlen($this->wm_font_color) == 6) 00307 { 00308 $this->wm_font_color = '#'.$this->wm_font_color; 00309 } 00310 } 00311 00312 if ($this->wm_shadow_color != '') 00313 { 00314 if (strlen($this->wm_shadow_color) == 6) 00315 { 00316 $this->wm_shadow_color = '#'.$this->wm_shadow_color; 00317 } 00318 } 00319 00320 if ($this->wm_overlay_path != '') 00321 { 00322 $this->wm_overlay_path = str_replace("\\", "/", realpath($this->wm_overlay_path)); 00323 } 00324 00325 if ($this->wm_shadow_color != '') 00326 { 00327 $this->wm_use_drop_shadow = TRUE; 00328 } 00329 00330 if ($this->wm_font_path != '') 00331 { 00332 $this->wm_use_truetype = TRUE; 00333 } 00334 00335 return TRUE; 00336 }


| CI_Image_lib::overlay_watermark | ( | ) |
Watermark - Graphic Version.
public
Definition at line 873 of file Image_lib.php.
References $x_axis, $y_axis, get_image_properties(), image_create_gd(), image_display_gd(), image_save_gd(), and set_error().
Referenced by watermark().
00874 { 00875 if ( ! function_exists('imagecolortransparent')) 00876 { 00877 $this->set_error('imglib_gd_required'); 00878 return FALSE; 00879 } 00880 00881 // Fetch source image properties 00882 $this->get_image_properties(); 00883 00884 // Fetch watermark image properties 00885 $props = $this->get_image_properties($this->wm_overlay_path, TRUE); 00886 $wm_img_type = $props['image_type']; 00887 $wm_width = $props['width']; 00888 $wm_height = $props['height']; 00889 00890 // Create two image resources 00891 $wm_img = $this->image_create_gd($this->wm_overlay_path, $wm_img_type); 00892 $src_img = $this->image_create_gd($this->full_src_path); 00893 00894 // Reverse the offset if necessary 00895 // When the image is positioned at the bottom 00896 // we don't want the vertical offset to push it 00897 // further down. We want the reverse, so we'll 00898 // invert the offset. Same with the horizontal 00899 // offset when the image is at the right 00900 00901 $this->wm_vrt_alignment = strtoupper(substr($this->wm_vrt_alignment, 0, 1)); 00902 $this->wm_hor_alignment = strtoupper(substr($this->wm_hor_alignment, 0, 1)); 00903 00904 if ($this->wm_vrt_alignment == 'B') 00905 $this->wm_vrt_offset = $this->wm_vrt_offset * -1; 00906 00907 if ($this->wm_hor_alignment == 'R') 00908 $this->wm_hor_offset = $this->wm_hor_offset * -1; 00909 00910 // Set the base x and y axis values 00911 $x_axis = $this->wm_hor_offset + $this->wm_padding; 00912 $y_axis = $this->wm_vrt_offset + $this->wm_padding; 00913 00914 // Set the vertical position 00915 switch ($this->wm_vrt_alignment) 00916 { 00917 case 'T': 00918 break; 00919 case 'M': $y_axis += ($this->orig_height / 2) - ($wm_height / 2); 00920 break; 00921 case 'B': $y_axis += $this->orig_height - $wm_height; 00922 break; 00923 } 00924 00925 // Set the horizontal position 00926 switch ($this->wm_hor_alignment) 00927 { 00928 case 'L': 00929 break; 00930 case 'C': $x_axis += ($this->orig_width / 2) - ($wm_width / 2); 00931 break; 00932 case 'R': $x_axis += $this->orig_width - $wm_width; 00933 break; 00934 } 00935 00936 // Build the finalized image 00937 if ($wm_img_type == 3 AND function_exists('imagealphablending')) 00938 { 00939 @imagealphablending($src_img, TRUE); 00940 } 00941 00942 // Set RGB values for text and shadow 00943 $rgba = imagecolorat($wm_img, $this->wm_x_transp, $this->wm_y_transp); 00944 $alpha = ($rgba & 0x7F000000) >> 24; 00945 00946 // make a best guess as to whether we're dealing with an image with alpha transparency or no/binary transparency 00947 if ($alpha > 0) 00948 { 00949 // copy the image directly, the image's alpha transparency being the sole determinant of blending 00950 imagecopy($src_img, $wm_img, $x_axis, $y_axis, 0, 0, $wm_width, $wm_height); 00951 } 00952 else 00953 { 00954 // set our RGB value from above to be transparent and merge the images with the specified opacity 00955 imagecolortransparent($wm_img, imagecolorat($wm_img, $this->wm_x_transp, $this->wm_y_transp)); 00956 imagecopymerge($src_img, $wm_img, $x_axis, $y_axis, 0, 0, $wm_width, $wm_height, $this->wm_opacity); 00957 } 00958 00959 // Output the image 00960 if ($this->dynamic_output == TRUE) 00961 { 00962 $this->image_display_gd($src_img); 00963 } 00964 else 00965 { 00966 if ( ! $this->image_save_gd($src_img)) 00967 { 00968 return FALSE; 00969 } 00970 } 00971 00972 imagedestroy($src_img); 00973 imagedestroy($wm_img); 00974 00975 return TRUE; 00976 }


| CI_Image_lib::resize | ( | ) |
Image Resize.
This is a wrapper function that chooses the proper resize function based on the protocol specified
public
Definition at line 349 of file Image_lib.php.
00350 { 00351 $protocol = 'image_process_'.$this->image_library; 00352 00353 if (eregi("gd2$", $protocol)) 00354 { 00355 $protocol = 'image_process_gd'; 00356 } 00357 00358 return $this->$protocol('resize'); 00359 }
| CI_Image_lib::rotate | ( | ) |
Image Rotate.
This is a wrapper function that chooses the proper rotation function based on the protocol specified
public
Definition at line 395 of file Image_lib.php.
References image_mirror_gd(), image_rotate_gd(), and set_error().
00396 { 00397 // Allowed rotation values 00398 $degs = array(90, 180, 270, 'vrt', 'hor'); 00399 00400 if ($this->rotation_angle == '' OR ! in_array($this->rotation_angle, $degs, TRUE)) 00401 { 00402 $this->set_error('imglib_rotation_angle_required'); 00403 return FALSE; 00404 } 00405 00406 // Reassign the width and height 00407 if ($this->rotation_angle == 90 OR $this->rotation_angle == 270) 00408 { 00409 $this->width = $this->orig_height; 00410 $this->height = $this->orig_width; 00411 } 00412 else 00413 { 00414 $this->width = $this->orig_width; 00415 $this->height = $this->orig_height; 00416 } 00417 00418 00419 // Choose resizing function 00420 if ($this->image_library == 'imagemagick' OR $this->image_library == 'netpbm') 00421 { 00422 $protocol = 'image_process_'.$this->image_library; 00423 00424 return $this->$protocol('rotate'); 00425 } 00426 00427 if ($this->rotation_angle == 'hor' OR $this->rotation_angle == 'vrt') 00428 { 00429 return $this->image_mirror_gd(); 00430 } 00431 else 00432 { 00433 return $this->image_rotate_gd(); 00434 } 00435 }

| CI_Image_lib::set_error | ( | $ | msg | ) |
Set error message.
public
| string |
Definition at line 1499 of file Image_lib.php.
References $CI, get_instance(), and log_message().
Referenced by get_image_properties(), image_create_gd(), image_process_imagemagick(), image_process_netpbm(), image_rotate_gd(), image_save_gd(), initialize(), overlay_watermark(), rotate(), and text_watermark().
01500 { 01501 $CI =& get_instance(); 01502 $CI->lang->load('imglib'); 01503 01504 if (is_array($msg)) 01505 { 01506 foreach ($msg as $val) 01507 { 01508 01509 $msg = ($CI->lang->line($val) == FALSE) ? $val : $CI->lang->line($val); 01510 $this->error_msg[] = $msg; 01511 log_message('error', $msg); 01512 } 01513 } 01514 else 01515 { 01516 $msg = ($CI->lang->line($msg) == FALSE) ? $msg : $CI->lang->line($msg); 01517 $this->error_msg[] = $msg; 01518 log_message('error', $msg); 01519 } 01520 }


| 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
| array |
Definition at line 1378 of file Image_lib.php.
01379 { 01380 if ( ! is_array($vals)) 01381 return; 01382 01383 $allowed = array('new_width', 'new_height', 'width', 'height'); 01384 01385 foreach ($allowed as $item) 01386 { 01387 if ( ! isset($vals[$item]) OR $vals[$item] == '') 01388 $vals[$item] = 0; 01389 } 01390 01391 if ($vals['width'] == 0 OR $vals['height'] == 0) 01392 { 01393 return $vals; 01394 } 01395 01396 if ($vals['new_width'] == 0) 01397 { 01398 $vals['new_width'] = ceil($vals['width']*$vals['new_height']/$vals['height']); 01399 } 01400 elseif ($vals['new_height'] == 0) 01401 { 01402 $vals['new_height'] = ceil($vals['new_width']*$vals['height']/$vals['width']); 01403 } 01404 01405 return $vals; 01406 }
| CI_Image_lib::text_watermark | ( | ) |
Watermark - Text Version.
public
Definition at line 986 of file Image_lib.php.
References $x_axis, $y_axis, get_image_properties(), image_create_gd(), image_display_gd(), image_save_gd(), and set_error().
Referenced by watermark().
00987 { 00988 if ( ! ($src_img = $this->image_create_gd())) 00989 { 00990 return FALSE; 00991 } 00992 00993 if ($this->wm_use_truetype == TRUE AND ! file_exists($this->wm_font_path)) 00994 { 00995 $this->set_error('imglib_missing_font'); 00996 return FALSE; 00997 } 00998 00999 // Fetch source image properties 01000 $this->get_image_properties(); 01001 01002 // Set RGB values for text and shadow 01003 $this->wm_font_color = str_replace('#', '', $this->wm_font_color); 01004 $this->wm_shadow_color = str_replace('#', '', $this->wm_shadow_color); 01005 01006 $R1 = hexdec(substr($this->wm_font_color, 0, 2)); 01007 $G1 = hexdec(substr($this->wm_font_color, 2, 2)); 01008 $B1 = hexdec(substr($this->wm_font_color, 4, 2)); 01009 01010 $R2 = hexdec(substr($this->wm_shadow_color, 0, 2)); 01011 $G2 = hexdec(substr($this->wm_shadow_color, 2, 2)); 01012 $B2 = hexdec(substr($this->wm_shadow_color, 4, 2)); 01013 01014 $txt_color = imagecolorclosest($src_img, $R1, $G1, $B1); 01015 $drp_color = imagecolorclosest($src_img, $R2, $G2, $B2); 01016 01017 // Reverse the vertical offset 01018 // When the image is positioned at the bottom 01019 // we don't want the vertical offset to push it 01020 // further down. We want the reverse, so we'll 01021 // invert the offset. Note: The horizontal 01022 // offset flips itself automatically 01023 01024 if ($this->wm_vrt_alignment == 'B') 01025 $this->wm_vrt_offset = $this->wm_vrt_offset * -1; 01026 01027 if ($this->wm_hor_alignment == 'R') 01028 $this->wm_hor_offset = $this->wm_hor_offset * -1; 01029 01030 // Set font width and height 01031 // These are calculated differently depending on 01032 // whether we are using the true type font or not 01033 if ($this->wm_use_truetype == TRUE) 01034 { 01035 if ($this->wm_font_size == '') 01036 $this->wm_font_size = '17'; 01037 01038 $fontwidth = $this->wm_font_size-($this->wm_font_size/4); 01039 $fontheight = $this->wm_font_size; 01040 $this->wm_vrt_offset += $this->wm_font_size; 01041 } 01042 else 01043 { 01044 $fontwidth = imagefontwidth($this->wm_font_size); 01045 $fontheight = imagefontheight($this->wm_font_size); 01046 } 01047 01048 // Set base X and Y axis values 01049 $x_axis = $this->wm_hor_offset + $this->wm_padding; 01050 $y_axis = $this->wm_vrt_offset + $this->wm_padding; 01051 01052 // Set verticle alignment 01053 if ($this->wm_use_drop_shadow == FALSE) 01054 $this->wm_shadow_distance = 0; 01055 01056 $this->wm_vrt_alignment = strtoupper(substr($this->wm_vrt_alignment, 0, 1)); 01057 $this->wm_hor_alignment = strtoupper(substr($this->wm_hor_alignment, 0, 1)); 01058 01059 switch ($this->wm_vrt_alignment) 01060 { 01061 case "T" : 01062 break; 01063 case "M": $y_axis += ($this->orig_height/2)+($fontheight/2); 01064 break; 01065 case "B": $y_axis += ($this->orig_height - $fontheight - $this->wm_shadow_distance - ($fontheight/2)); 01066 break; 01067 } 01068 01069 $x_shad = $x_axis + $this->wm_shadow_distance; 01070 $y_shad = $y_axis + $this->wm_shadow_distance; 01071 01072 // Set horizontal alignment 01073 switch ($this->wm_hor_alignment) 01074 { 01075 case "L": 01076 break; 01077 case "R": 01078 if ($this->wm_use_drop_shadow) 01079 $x_shad += ($this->orig_width - $fontwidth*strlen($this->wm_text)); 01080 $x_axis += ($this->orig_width - $fontwidth*strlen($this->wm_text)); 01081 break; 01082 case "C": 01083 if ($this->wm_use_drop_shadow) 01084 $x_shad += floor(($this->orig_width - $fontwidth*strlen($this->wm_text))/2); 01085 $x_axis += floor(($this->orig_width -$fontwidth*strlen($this->wm_text))/2); 01086 break; 01087 } 01088 01089 // Add the text to the source image 01090 if ($this->wm_use_truetype) 01091 { 01092 if ($this->wm_use_drop_shadow) 01093 imagettftext($src_img, $this->wm_font_size, 0, $x_shad, $y_shad, $drp_color, $this->wm_font_path, $this->wm_text); 01094 imagettftext($src_img, $this->wm_font_size, 0, $x_axis, $y_axis, $txt_color, $this->wm_font_path, $this->wm_text); 01095 } 01096 else 01097 { 01098 if ($this->wm_use_drop_shadow) 01099 imagestring($src_img, $this->wm_font_size, $x_shad, $y_shad, $this->wm_text, $drp_color); 01100 imagestring($src_img, $this->wm_font_size, $x_axis, $y_axis, $this->wm_text, $txt_color); 01101 } 01102 01103 // Output the final image 01104 if ($this->dynamic_output == TRUE) 01105 { 01106 $this->image_display_gd($src_img); 01107 } 01108 else 01109 { 01110 $this->image_save_gd($src_img); 01111 } 01112 01113 imagedestroy($src_img); 01114 01115 return TRUE; 01116 }


| CI_Image_lib::watermark | ( | ) |
Image Watermark.
This is a wrapper function that chooses the type of watermarking based on the specified preference.
public
| string |
Definition at line 853 of file Image_lib.php.
References overlay_watermark(), and text_watermark().
00854 { 00855 if ($this->wm_type == 'overlay') 00856 { 00857 return $this->overlay_watermark(); 00858 } 00859 else 00860 { 00861 return $this->text_watermark(); 00862 } 00863 }

| CI_Image_lib::$copy_fnc = 'imagecopyresampled' |
Definition at line 74 of file Image_lib.php.
| CI_Image_lib::$create_fnc = 'imagecreatetruecolor' |
Definition at line 73 of file Image_lib.php.
| CI_Image_lib::$create_thumb = FALSE |
Definition at line 37 of file Image_lib.php.
| CI_Image_lib::$dest_folder = '' |
Definition at line 65 of file Image_lib.php.
| CI_Image_lib::$dynamic_output = FALSE |
Definition at line 31 of file Image_lib.php.
| CI_Image_lib::$error_msg = array() |
Definition at line 75 of file Image_lib.php.
| CI_Image_lib::$full_dst_path = '' |
Definition at line 72 of file Image_lib.php.
| CI_Image_lib::$full_src_path = '' |
Definition at line 71 of file Image_lib.php.
| CI_Image_lib::$height = '' |
| CI_Image_lib::$image_library = 'gd2' |
Definition at line 29 of file Image_lib.php.
| CI_Image_lib::$image_type = '' |
| CI_Image_lib::$library_path = '' |
Definition at line 30 of file Image_lib.php.
| CI_Image_lib::$maintain_ratio = TRUE |
Definition at line 39 of file Image_lib.php.
| CI_Image_lib::$master_dim = 'auto' |
Definition at line 40 of file Image_lib.php.
| CI_Image_lib::$mime_type = '' |
Definition at line 66 of file Image_lib.php.
| CI_Image_lib::$new_image = '' |
Definition at line 33 of file Image_lib.php.
| CI_Image_lib::$orig_height = '' |
Definition at line 68 of file Image_lib.php.
| CI_Image_lib::$orig_width = '' |
Definition at line 67 of file Image_lib.php.
| CI_Image_lib::$quality = '90' |
Definition at line 36 of file Image_lib.php.
| CI_Image_lib::$rotation_angle = '' |
Definition at line 41 of file Image_lib.php.
| CI_Image_lib::$size_str = '' |
Definition at line 70 of file Image_lib.php.
| CI_Image_lib::$source_folder = '' |
Definition at line 64 of file Image_lib.php.
| CI_Image_lib::$source_image = '' |
| CI_Image_lib::$thumb_marker = '_thumb' |
Definition at line 38 of file Image_lib.php.
| CI_Image_lib::$width = '' |
| CI_Image_lib::$wm_font_color = '#ffffff' |
Definition at line 58 of file Image_lib.php.
| CI_Image_lib::$wm_font_path = '' |
Definition at line 51 of file Image_lib.php.
| CI_Image_lib::$wm_font_size = 17 |
Definition at line 52 of file Image_lib.php.
| CI_Image_lib::$wm_hor_alignment = 'C' |
Definition at line 54 of file Image_lib.php.
| CI_Image_lib::$wm_hor_offset = 0 |
Definition at line 56 of file Image_lib.php.
| CI_Image_lib::$wm_opacity = 50 |
Definition at line 61 of file Image_lib.php.
| CI_Image_lib::$wm_overlay_path = '' |
Definition at line 50 of file Image_lib.php.
| CI_Image_lib::$wm_padding = 0 |
Definition at line 55 of file Image_lib.php.
| CI_Image_lib::$wm_shadow_color = '' |
Definition at line 59 of file Image_lib.php.
| CI_Image_lib::$wm_shadow_distance = 2 |
Definition at line 60 of file Image_lib.php.
| CI_Image_lib::$wm_text = '' |
Definition at line 46 of file Image_lib.php.
| CI_Image_lib::$wm_type = 'text' |
Definition at line 47 of file Image_lib.php.
| CI_Image_lib::$wm_use_drop_shadow = FALSE |
Definition at line 76 of file Image_lib.php.
| CI_Image_lib::$wm_use_truetype = FALSE |
Definition at line 77 of file Image_lib.php.
| CI_Image_lib::$wm_vrt_alignment = 'B' |
Definition at line 53 of file Image_lib.php.
| CI_Image_lib::$wm_vrt_offset = 0 |
Definition at line 57 of file Image_lib.php.
| CI_Image_lib::$wm_x_transp = 4 |
Definition at line 48 of file Image_lib.php.
| CI_Image_lib::$wm_y_transp = 4 |
Definition at line 49 of file Image_lib.php.
| CI_Image_lib::$x_axis = '' |
Definition at line 42 of file Image_lib.php.
Referenced by overlay_watermark(), and text_watermark().
| CI_Image_lib::$y_axis = '' |
Definition at line 43 of file Image_lib.php.
Referenced by overlay_watermark(), and text_watermark().