PHP 클래스 CI_Image_lib, TastyIgniter

저자: ExpressionEngine Dev Team
파일 보기 프로젝트 열기: tastyigniter/tastyigniter 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$copy_fnc string Name of function to copy image
$create_fnc string Name of function to create image
$create_thumb boolean Whether to create a thumbnail
$dest_folder string Destination image folder
$dynamic_output boolean Whether to send to browser or write to disk
$error_msg array Error messages
$file_permissions integer File permissions
$full_dst_path string Full path to destination image
$full_src_path string Full path to source image
$height integer Image height
$image_library string PHP extension/library to use for image manipulation Can be: imagemagick, netpbm, gd, gd2
$image_type string Image format
$library_path string Path to the graphic library (if applicable)
$maintain_ratio boolean Whether to maintain aspect ratio when resizing or use hard values
$master_dim string auto, height, or width. Determines what to use as the master dimension
$mime_type string Image mime-type
$new_image string Path to the modified image
$orig_height integer Original image height
$orig_width integer Original image width
$quality integer Quality percentage of new image
$rotation_angle string Angle at to rotate image
$size_str string Size of current image
$source_folder string Source image folder
$source_image string Path to original image
$thumb_marker string String to add to thumbnail version of image
$width integer Image width
$wm_font_path string TT font
$wm_font_size integer Font size (different versions of GD will either use points or pixels)
$wm_hor_alignment string Horizontal alignment: L R C
$wm_hor_offset integer Lets you push text to the right
$wm_opacity integer Image opacity: 1 - 100 Only works with image
$wm_overlay_path string Watermark image path
$wm_padding integer Padding around text
$wm_shadow_distance integer Dropshadow distance
$wm_text string Watermark text if graphic is not used
$wm_type string Type of watermarking. Options: text/overlay
$wm_use_truetype boolean Whether to use truetype fonts
$wm_vrt_alignment string Vertical alignment: T M B
$wm_vrt_offset integer Lets you push text down
$wm_x_transp integer Default transparency for watermark
$wm_y_transp integer Default transparency for watermark
$x_axis integer X Coordinate for manipulation of the current image
$y_axis integer Y Coordinate for manipulation of the current image

보호된 프로퍼티들

프로퍼티 타입 설명
$wm_font_color string Text color
$wm_shadow_color string Dropshadow color
$wm_use_drop_shadow boolean Whether to have a drop shadow on watermark

공개 메소드들

메소드 설명
__construct ( array $props = [] ) : void Initialize Image Library
clear ( ) : void Initialize image properties
crop ( ) : boolean Image Crop
display_errors ( $open = '<p>', $close = '</p>' ) : string Show error messages
explode_name ( $source_image ) : array Explode source_image
gd_loaded ( ) : boolean Is GD Installed?
gd_version ( ) : mixed Get GD version
get_image_properties ( $path = '', $return = FALSE ) : mixed Get image properties
image_create_gd ( $path = '', $image_type = '' ) : resource Create Image - GD
image_display_gd ( $resource ) : void Dynamically outputs an image
image_mirror_gd ( ) : boolean Create Mirror Image using GD
image_process_gd ( $action = 'resize' ) : boolean Image Process Using GD/GD2
image_process_imagemagick ( $action = 'resize' ) : boolean Image Process Using ImageMagick
image_process_netpbm ( $action = 'resize' ) : boolean Image Process Using NetPBM
image_reproportion ( ) : void Re-proportion Image Width/Height
image_rotate_gd ( ) : boolean Image Rotate Using GD
image_save_gd ( $resource ) : boolean Write image file to disk - GD
initialize ( $props = [] ) : boolean initialize image preferences
overlay_watermark ( ) : boolean Watermark - Graphic Version
resize ( ) : boolean Image Resize
rotate ( ) : boolean Image Rotate
set_error ( $msg ) : void Set error message
size_calculator ( $vals ) : array Size calculator
text_watermark ( ) : boolean Watermark - Text Version
watermark ( ) : boolean Image Watermark

메소드 상세

__construct() 공개 메소드

Initialize Image Library
public __construct ( array $props = [] ) : void
$props array
리턴 void

clear() 공개 메소드

Resets values in case this class is used in a loop
public clear ( ) : void
리턴 void

crop() 공개 메소드

This is a wrapper function that chooses the proper cropping function based on the protocol specified
public crop ( ) : boolean
리턴 boolean

display_errors() 공개 메소드

Show error messages
public display_errors ( $open = '<p>', $close = '</p>' ) : string
리턴 string

explode_name() 공개 메소드

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 explode_name ( $source_image ) : array
리턴 array

gd_loaded() 공개 메소드

Is GD Installed?
public gd_loaded ( ) : boolean
리턴 boolean

gd_version() 공개 메소드

Get GD version
public gd_version ( ) : mixed
리턴 mixed

get_image_properties() 공개 메소드

A helper function that gets info about the file
public get_image_properties ( $path = '', $return = FALSE ) : mixed
리턴 mixed

image_create_gd() 공개 메소드

This simply creates an image resource handle based on the type of image being processed
public image_create_gd ( $path = '', $image_type = '' ) : resource
리턴 resource

image_display_gd() 공개 메소드

Dynamically outputs an image
public image_display_gd ( $resource ) : void
리턴 void

image_mirror_gd() 공개 메소드

This function will flip horizontal or vertical
public image_mirror_gd ( ) : boolean
리턴 boolean

image_process_gd() 공개 메소드

This function will resize or crop
public image_process_gd ( $action = 'resize' ) : boolean
리턴 boolean

image_process_imagemagick() 공개 메소드

This function will resize, crop or rotate
public image_process_imagemagick ( $action = 'resize' ) : boolean
리턴 boolean

image_process_netpbm() 공개 메소드

This function will resize, crop or rotate
public image_process_netpbm ( $action = 'resize' ) : boolean
리턴 boolean

image_reproportion() 공개 메소드

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_reproportion ( ) : void
리턴 void

image_rotate_gd() 공개 메소드

Image Rotate Using GD
public image_rotate_gd ( ) : boolean
리턴 boolean

image_save_gd() 공개 메소드

Takes an image resource as input and writes the file to the specified destination
public image_save_gd ( $resource ) : boolean
리턴 boolean

initialize() 공개 메소드

initialize image preferences
public initialize ( $props = [] ) : boolean
리턴 boolean

overlay_watermark() 공개 메소드

Watermark - Graphic Version
public overlay_watermark ( ) : boolean
리턴 boolean

resize() 공개 메소드

This is a wrapper function that chooses the proper resize function based on the protocol specified
public resize ( ) : boolean
리턴 boolean

rotate() 공개 메소드

This is a wrapper function that chooses the proper rotation function based on the protocol specified
public rotate ( ) : boolean
리턴 boolean

set_error() 공개 메소드

Set error message
public set_error ( $msg ) : void
리턴 void

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 size_calculator ( $vals ) : array
리턴 array

text_watermark() 공개 메소드

Watermark - Text Version
public text_watermark ( ) : boolean
리턴 boolean

watermark() 공개 메소드

This is a wrapper function that chooses the type of watermarking based on the specified preference.
public watermark ( ) : boolean
리턴 boolean

프로퍼티 상세

$copy_fnc 공개적으로 프로퍼티

Name of function to copy image
public string $copy_fnc
리턴 string

$create_fnc 공개적으로 프로퍼티

Name of function to create image
public string $create_fnc
리턴 string

$create_thumb 공개적으로 프로퍼티

Whether to create a thumbnail
public bool $create_thumb
리턴 boolean

$dest_folder 공개적으로 프로퍼티

Destination image folder
public string $dest_folder
리턴 string

$dynamic_output 공개적으로 프로퍼티

Whether to send to browser or write to disk
public bool $dynamic_output
리턴 boolean

$error_msg 공개적으로 프로퍼티

Error messages
public array $error_msg
리턴 array

$file_permissions 공개적으로 프로퍼티

File permissions
public int $file_permissions
리턴 integer

$full_dst_path 공개적으로 프로퍼티

Full path to destination image
public string $full_dst_path
리턴 string

$full_src_path 공개적으로 프로퍼티

Full path to source image
public string $full_src_path
리턴 string

$height 공개적으로 프로퍼티

Image height
public int $height
리턴 integer

$image_library 공개적으로 프로퍼티

PHP extension/library to use for image manipulation Can be: imagemagick, netpbm, gd, gd2
public string $image_library
리턴 string

$image_type 공개적으로 프로퍼티

Image format
public string $image_type
리턴 string

$library_path 공개적으로 프로퍼티

Path to the graphic library (if applicable)
public string $library_path
리턴 string

$maintain_ratio 공개적으로 프로퍼티

Whether to maintain aspect ratio when resizing or use hard values
public bool $maintain_ratio
리턴 boolean

$master_dim 공개적으로 프로퍼티

auto, height, or width. Determines what to use as the master dimension
public string $master_dim
리턴 string

$mime_type 공개적으로 프로퍼티

Image mime-type
public string $mime_type
리턴 string

$new_image 공개적으로 프로퍼티

Path to the modified image
public string $new_image
리턴 string

$orig_height 공개적으로 프로퍼티

Original image height
public int $orig_height
리턴 integer

$orig_width 공개적으로 프로퍼티

Original image width
public int $orig_width
리턴 integer

$quality 공개적으로 프로퍼티

Quality percentage of new image
public int $quality
리턴 integer

$rotation_angle 공개적으로 프로퍼티

Angle at to rotate image
public string $rotation_angle
리턴 string

$size_str 공개적으로 프로퍼티

Size of current image
public string $size_str
리턴 string

$source_folder 공개적으로 프로퍼티

Source image folder
public string $source_folder
리턴 string

$source_image 공개적으로 프로퍼티

Path to original image
public string $source_image
리턴 string

$thumb_marker 공개적으로 프로퍼티

String to add to thumbnail version of image
public string $thumb_marker
리턴 string

$width 공개적으로 프로퍼티

Image width
public int $width
리턴 integer

$wm_font_color 보호되어 있는 프로퍼티

Text color
protected string $wm_font_color
리턴 string

$wm_font_path 공개적으로 프로퍼티

TT font
public string $wm_font_path
리턴 string

$wm_font_size 공개적으로 프로퍼티

Font size (different versions of GD will either use points or pixels)
public int $wm_font_size
리턴 integer

$wm_hor_alignment 공개적으로 프로퍼티

Horizontal alignment: L R C
public string $wm_hor_alignment
리턴 string

$wm_hor_offset 공개적으로 프로퍼티

Lets you push text to the right
public int $wm_hor_offset
리턴 integer

$wm_opacity 공개적으로 프로퍼티

Image opacity: 1 - 100 Only works with image
public int $wm_opacity
리턴 integer

$wm_overlay_path 공개적으로 프로퍼티

Watermark image path
public string $wm_overlay_path
리턴 string

$wm_padding 공개적으로 프로퍼티

Padding around text
public int $wm_padding
리턴 integer

$wm_shadow_color 보호되어 있는 프로퍼티

Dropshadow color
protected string $wm_shadow_color
리턴 string

$wm_shadow_distance 공개적으로 프로퍼티

Dropshadow distance
public int $wm_shadow_distance
리턴 integer

$wm_text 공개적으로 프로퍼티

Watermark text if graphic is not used
public string $wm_text
리턴 string

$wm_type 공개적으로 프로퍼티

Type of watermarking. Options: text/overlay
public string $wm_type
리턴 string

$wm_use_drop_shadow 보호되어 있는 프로퍼티

Whether to have a drop shadow on watermark
protected bool $wm_use_drop_shadow
리턴 boolean

$wm_use_truetype 공개적으로 프로퍼티

Whether to use truetype fonts
public bool $wm_use_truetype
리턴 boolean

$wm_vrt_alignment 공개적으로 프로퍼티

Vertical alignment: T M B
public string $wm_vrt_alignment
리턴 string

$wm_vrt_offset 공개적으로 프로퍼티

Lets you push text down
public int $wm_vrt_offset
리턴 integer

$wm_x_transp 공개적으로 프로퍼티

Default transparency for watermark
public int $wm_x_transp
리턴 integer

$wm_y_transp 공개적으로 프로퍼티

Default transparency for watermark
public int $wm_y_transp
리턴 integer

$x_axis 공개적으로 프로퍼티

X Coordinate for manipulation of the current image
public int $x_axis
리턴 integer

$y_axis 공개적으로 프로퍼티

Y Coordinate for manipulation of the current image
public int $y_axis
리턴 integer