-
Notifications
You must be signed in to change notification settings - Fork 0
Class CI_Image_lib
##Class CI_Image_lib
Image Manipulation class
Package: [[CodeIgniter<a href="Package CodeIgniter.Libraries.md">Libraries]]
Category:
Image_lib
Author:
ExpressionEngine Dev Team
Link:
http://codeigniter.com/user_guide/libraries/image_lib.html
Located at system/libraries/Image_lib.php
##Methods summary
public __construct ( string $props = array() )
Constructor
Parameters
$props
string
public clear ( )
Initialize image properties
Resets values in case this class is used in a loop
public boolean initialize ( array $props = array() )
initialize image preferences
Parameters
$props
array
Returns
boolean
public boolean resize ( )
Image Resize
This is a wrapper function that chooses the proper resize function based on the protocol specified
Returns
boolean
public boolean crop ( )
Image Crop
This is a wrapper function that chooses the proper cropping function based on the protocol specified
Returns
boolean
public boolean rotate ( )
Image Rotate
This is a wrapper function that chooses the proper rotation function based on the protocol specified
Returns
boolean
public boolean image_process_gd ( string $action = 'resize' )
Image Process Using GD/GD2
This function will resize or crop
Parameters
$action
string
Returns
boolean
public boolean image_process_imagemagick ( string $action = 'resize' )
Image Process Using ImageMagick
This function will resize, crop or rotate
Parameters
$action
string
Returns
boolean
public boolean image_process_netpbm ( string $action = 'resize' )
Image Process Using NetPBM
This function will resize, crop or rotate
Parameters
$action
string
Returns
boolean
public boolean image_rotate_gd ( )
Image Rotate Using GD
Returns
boolean
public boolean image_mirror_gd ( )
Create Mirror Image using GD
This function will flip horizontal or vertical
Returns
boolean
public boolean watermark ( )
Image Watermark
This is a wrapper function that chooses the type of watermarking based on the specified preference.
Returns
boolean
public boolean overlay_watermark ( )
Watermark - Graphic Version
Returns
boolean
public boolean text_watermark ( )
Watermark - Text Version
Returns
boolean
public resource image_create_gd ( string $path = '', mixed $image_type = '' )
Create Image - GD
This simply creates an image resource handle based on the type of image being processed
Parameters
$path
string
$image_type
Returns
resource
public boolean image_save_gd ( resource $resource )
Write image file to disk - GD
Takes an image resource as input and writes the file to the specified destination
Parameters
$resource
resource
Returns
boolean
public image_display_gd ( resource $resource )
Dynamically outputs an image
Parameters
$resource
resource
public 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 mixed get_image_properties ( string $path = '', mixed $return = FALSE )
Get image properties
A helper function that gets info about the file
Parameters
$path
string
$return
Returns
mixed
public array size_calculator ( array $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' => '' );
Parameters
$vals
array
Returns
array
public array explode_name ( array $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';
Parameters
$source_image
array
Returns
array
public boolean gd_loaded ( )
Is GD Installed?
Returns
boolean
public mixed gd_version ( )
Get GD version
Returns
mixed
public set_error ( string $msg )
Set error message
Parameters
$msg
string
public string display_errors ( string $open = '<p>', mixed $close = '</p>' )
Show error messages
Parameters
$open
string
$close
Returns
string
<table class="summary" id="properties">
<caption>Properties summary</caption>
<tr data-order="image_library" id="$image_library">
<td class="attributes"><code>
public
string
</code></td>
<td class="name">
$image_library
'gd2'
<div class="description detailed">
</div>
</div></td>
</tr>
<tr data-order="library_path" id="$library_path">
<td class="attributes"><code>
public
string
</code></td>
<td class="name">
$library_path
''
<div class="description detailed">
</div>
</div></td>
</tr>
<tr data-order="dynamic_output" id="$dynamic_output">
<td class="attributes"><code>
public
boolean
</code></td>
<td class="name">
$dynamic_output
FALSE
<div class="description detailed">
</div>
</div></td>
</tr>
<tr data-order="source_image" id="$source_image">
<td class="attributes"><code>
public
string
</code></td>
<td class="name">
$source_image
''
<div class="description detailed">
</div>
</div></td>
</tr>
<tr data-order="new_image" id="$new_image">
<td class="attributes"><code>
public
string
</code></td>
<td class="name">
$new_image
''
<div class="description detailed">
</div>
</div></td>
</tr>
<tr data-order="width" id="$width">
<td class="attributes"><code>
public
string
</code></td>
<td class="name">
$width
''
<div class="description detailed">
</div>
</div></td>
</tr>
<tr data-order="height" id="$height">
<td class="attributes"><code>
public
string
</code></td>
<td class="name">
$height
''
<div class="description detailed">
</div>
</div></td>
</tr>
<tr data-order="quality" id="$quality">
<td class="attributes"><code>
public
string
</code></td>
<td class="name">
$quality
'90'
<div class="description detailed">
</div>
</div></td>
</tr>
<tr data-order="create_thumb" id="$create_thumb">
<td class="attributes"><code>
public
boolean
</code></td>
<td class="name">
$create_thumb
FALSE
<div class="description detailed">
</div>
</div></td>
</tr>
<tr data-order="thumb_marker" id="$thumb_marker">
<td class="attributes"><code>
public
string
</code></td>
<td class="name">
$thumb_marker
'_thumb'
<div class="description detailed">
</div>
</div></td>
</tr>
<tr data-order="maintain_ratio" id="$maintain_ratio">
<td class="attributes"><code>
public
boolean
</code></td>
<td class="name">
$maintain_ratio
TRUE
<div class="description detailed">
</div>
</div></td>
</tr>
<tr data-order="master_dim" id="$master_dim">
<td class="attributes"><code>
public
string
</code></td>
<td class="name">
$master_dim
'auto'
<div class="description detailed">
</div>
</div></td>
</tr>
<tr data-order="rotation_angle" id="$rotation_angle">
<td class="attributes"><code>
public
string
</code></td>
<td class="name">
$rotation_angle
''
<div class="description detailed">
</div>
</div></td>
</tr>
<tr data-order="x_axis" id="$x_axis">
<td class="attributes"><code>
public
string
</code></td>
<td class="name">
$x_axis
''
<div class="description detailed">
</div>
</div></td>
</tr>
<tr data-order="y_axis" id="$y_axis">
<td class="attributes"><code>
public
string
</code></td>
<td class="name">
$y_axis
''
<div class="description detailed">
</div>
</div></td>
</tr>
<tr data-order="wm_text" id="$wm_text">
<td class="attributes"><code>
public
string
</code></td>
<td class="name">
$wm_text
''
<div class="description detailed">
</div>
</div></td>
</tr>
<tr data-order="wm_type" id="$wm_type">
<td class="attributes"><code>
public
string
</code></td>
<td class="name">
$wm_type
'text'
<div class="description detailed">
</div>
</div></td>
</tr>
<tr data-order="wm_x_transp" id="$wm_x_transp">
<td class="attributes"><code>
public
integer
</code></td>
<td class="name">
$wm_x_transp
4
<div class="description detailed">
</div>
</div></td>
</tr>
<tr data-order="wm_y_transp" id="$wm_y_transp">
<td class="attributes"><code>
public
integer
</code></td>
<td class="name">
$wm_y_transp
4
<div class="description detailed">
</div>
</div></td>
</tr>
<tr data-order="wm_overlay_path" id="$wm_overlay_path">
<td class="attributes"><code>
public
string
</code></td>
<td class="name">
$wm_overlay_path
''
<div class="description detailed">
</div>
</div></td>
</tr>
<tr data-order="wm_font_path" id="$wm_font_path">
<td class="attributes"><code>
public
string
</code></td>
<td class="name">
$wm_font_path
''
<div class="description detailed">
</div>
</div></td>
</tr>
<tr data-order="wm_font_size" id="$wm_font_size">
<td class="attributes"><code>
public
integer
</code></td>
<td class="name">
$wm_font_size
17
<div class="description detailed">
</div>
</div></td>
</tr>
<tr data-order="wm_vrt_alignment" id="$wm_vrt_alignment">
<td class="attributes"><code>
public
string
</code></td>
<td class="name">
$wm_vrt_alignment
'B'
<div class="description detailed">
</div>
</div></td>
</tr>
<tr data-order="wm_hor_alignment" id="$wm_hor_alignment">
<td class="attributes"><code>
public
string
</code></td>
<td class="name">
$wm_hor_alignment
'C'
<div class="description detailed">
</div>
</div></td>
</tr>
<tr data-order="wm_padding" id="$wm_padding">
<td class="attributes"><code>
public
integer
</code></td>
<td class="name">
$wm_padding
0
<div class="description detailed">
</div>
</div></td>
</tr>
<tr data-order="wm_hor_offset" id="$wm_hor_offset">
<td class="attributes"><code>
public
integer
</code></td>
<td class="name">
$wm_hor_offset
0
<div class="description detailed">
</div>
</div></td>
</tr>
<tr data-order="wm_vrt_offset" id="$wm_vrt_offset">
<td class="attributes"><code>
public
integer
</code></td>
<td class="name">
$wm_vrt_offset
0
<div class="description detailed">
</div>
</div></td>
</tr>
<tr data-order="wm_font_color" id="$wm_font_color">
<td class="attributes"><code>
public
string
</code></td>
<td class="name">
$wm_font_color
'#ffffff'
<div class="description detailed">
</div>
</div></td>
</tr>
<tr data-order="wm_shadow_color" id="$wm_shadow_color">
<td class="attributes"><code>
public
string
</code></td>
<td class="name">
$wm_shadow_color
''
<div class="description detailed">
</div>
</div></td>
</tr>
<tr data-order="wm_shadow_distance" id="$wm_shadow_distance">
<td class="attributes"><code>
public
integer
</code></td>
<td class="name">
$wm_shadow_distance
2
<div class="description detailed">
</div>
</div></td>
</tr>
<tr data-order="wm_opacity" id="$wm_opacity">
<td class="attributes"><code>
public
integer
</code></td>
<td class="name">
$wm_opacity
50
<div class="description detailed">
</div>
</div></td>
</tr>
<tr data-order="source_folder" id="$source_folder">
<td class="attributes"><code>
public
string
</code></td>
<td class="name">
$source_folder
''
<div class="description detailed">
</div>
</div></td>
</tr>
<tr data-order="dest_folder" id="$dest_folder">
<td class="attributes"><code>
public
string
</code></td>
<td class="name">
$dest_folder
''
<div class="description detailed">
</div>
</div></td>
</tr>
<tr data-order="mime_type" id="$mime_type">
<td class="attributes"><code>
public
string
</code></td>
<td class="name">
$mime_type
''
<div class="description detailed">
</div>
</div></td>
</tr>
<tr data-order="orig_width" id="$orig_width">
<td class="attributes"><code>
public
string
</code></td>
<td class="name">
$orig_width
''
<div class="description detailed">
</div>
</div></td>
</tr>
<tr data-order="orig_height" id="$orig_height">
<td class="attributes"><code>
public
string
</code></td>
<td class="name">
$orig_height
''
<div class="description detailed">
</div>
</div></td>
</tr>
<tr data-order="image_type" id="$image_type">
<td class="attributes"><code>
public
string
</code></td>
<td class="name">
$image_type
''
<div class="description detailed">
</div>
</div></td>
</tr>
<tr data-order="size_str" id="$size_str">
<td class="attributes"><code>
public
string
</code></td>
<td class="name">
$size_str
''
<div class="description detailed">
</div>
</div></td>
</tr>
<tr data-order="full_src_path" id="$full_src_path">
<td class="attributes"><code>
public
string
</code></td>
<td class="name">
$full_src_path
''
<div class="description detailed">
</div>
</div></td>
</tr>
<tr data-order="full_dst_path" id="$full_dst_path">
<td class="attributes"><code>
public
string
</code></td>
<td class="name">
$full_dst_path
''
<div class="description detailed">
</div>
</div></td>
</tr>
<tr data-order="create_fnc" id="$create_fnc">
<td class="attributes"><code>
public
string
</code></td>
<td class="name">
$create_fnc
'imagecreatetruecolor'
<div class="description detailed">
</div>
</div></td>
</tr>
<tr data-order="copy_fnc" id="$copy_fnc">
<td class="attributes"><code>
public
string
</code></td>
<td class="name">
$copy_fnc
'imagecopyresampled'
<div class="description detailed">
</div>
</div></td>
</tr>
<tr data-order="error_msg" id="$error_msg">
<td class="attributes"><code>
public
array
</code></td>
<td class="name">
$error_msg
array()
<div class="description detailed">
</div>
</div></td>
</tr>
<tr data-order="wm_use_drop_shadow" id="$wm_use_drop_shadow">
<td class="attributes"><code>
public
boolean
</code></td>
<td class="name">
$wm_use_drop_shadow
FALSE
<div class="description detailed">
</div>
</div></td>
</tr>
<tr data-order="wm_use_truetype" id="$wm_use_truetype">
<td class="attributes"><code>
public
boolean
</code></td>
<td class="name">
$wm_use_truetype
FALSE
<div class="description detailed">
</div>
</div></td>
</tr>
</table>
API documentation generated by ApiGen 2.8.0
- application
- controlllers
- libraries
- models
- CodeIgniter
- Drivers
- Libraries
- None
- PHP
- Services
- Soundcloud
- About
- API_Controller
- Audioupload_lib
- Auth
- BaseFacebook
- Beats
- Beta
- CI_Benchmark
- CI_Cache
- CI_Cache_apc
- CI_Cache_dummy
- CI_Cache_file
- CI_Cache_memcached
- CI_Calendar
- CI_Cart
- CI_Config
- CI_Controller
- CI_DB_active_record
- CI_DB_Cache
- CI_DB_cubrid_driver
- CI_DB_cubrid_forge
- CI_DB_cubrid_result
- CI_DB_cubrid_utility
- CI_DB_driver
- CI_DB_forge
- CI_DB_mssql_driver
- CI_DB_mssql_forge
- CI_DB_mssql_result
- CI_DB_mssql_utility
- CI_DB_mysql_driver
- CI_DB_mysql_forge
- CI_DB_mysql_result
- CI_DB_mysql_utility
- CI_DB_mysqli_driver
- CI_DB_mysqli_forge
- CI_DB_mysqli_result
- CI_DB_mysqli_utility
- CI_DB_oci8_driver
- CI_DB_oci8_forge
- CI_DB_oci8_result
- CI_DB_oci8_utility
- CI_DB_odbc_driver
- CI_DB_odbc_forge
- CI_DB_odbc_result
- CI_DB_odbc_utility
- CI_DB_pdo_driver
- CI_DB_pdo_forge
- CI_DB_pdo_result
- CI_DB_pdo_utility
- CI_DB_postgre_driver
- CI_DB_postgre_forge
- CI_DB_postgre_result
- CI_DB_postgre_utility
- CI_DB_result
- CI_DB_sqlite_driver
- CI_DB_sqlite_forge
- CI_DB_sqlite_result
- CI_DB_sqlite_utility
- CI_DB_sqlsrv_driver
- CI_DB_sqlsrv_forge
- CI_DB_sqlsrv_result
- CI_DB_sqlsrv_utility
- CI_DB_utility
- CI_Driver
- CI_Driver_Library
- CI_Email
- CI_Encrypt
- CI_Exceptions
- CI_Form_validation
- CI_FTP
- CI_Hooks
- CI_Image_lib
- CI_Input
- CI_Javascript
- CI_Jquery
- CI_Lang
- CI_Loader
- CI_Log
- CI_Migration
- CI_Model
- CI_Output
- CI_Pagination
- CI_Parser
- CI_Profiler
- CI_Router
- CI_Security
- CI_Session
- CI_SHA1
- CI_Table
- CI_Trackback
- CI_Typography
- CI_Unit_test
- CI_Upload
- CI_URI
- CI_User_agent
- CI_Utf8
- CI_Xmlrpc
- CI_Xmlrpcs
- CI_Zip
- Comments_model
- CommercialContent_model
- Components
- Components_model
- Credits_model
- Dashboard
- DevTools
- Download
- Faq
- Featrequest_lib
- Feats
- Feats_model
- FormatterAbstract
- Framework_Controller
- Json_Response
- Local
- Main
- Notification_Formatter
- Notifications_model
- OAUTH_ALGORITHMS
- People
- Points_lib
- Projects
- Search
- SeenContent_model
- Services_Soundcloud
- Services_Soundcloud_Version
- Settings
- Showcases
- Tabs
- Template
- Tools
- UsageNotification
- Users
- Users_lib
- Users_model
- Videos
- vimeo_oauth
- Voices
- XML_RPC_Client
- XML_RPC_Message
- XML_RPC_Response
- XML_RPC_Values
- Exception
- FacebookApiException
- Services_Soundcloud_Invalid_Http_Response_Code_Exception
- Services_Soundcloud_Missing_Client_Id_Exception
- Services_Soundcloud_Unsupported_Audio_Format_Exception
- Services_Soundcloud_Unsupported_Response_Format_Exception
- _attributes_to_string
- _exception_handler
- _get_smiley_array
- _get_validation_object
- _list
- _parse_attributes
- _parse_form_attributes
- alternator
- anchor
- anchor_popup
- ascii_to_entities
- auto_link
- auto_typography
- base64_url_decode
- base_url
- bitly
- br
- build_auth_array
- build_auth_string
- byte_format
- c
- camelize
- canonical_timediff
- character_limiter
- ci_factory
- config_item
- convert_accented_characters
- create_captcha
- curl
- currencyToFloat
- current_url
- days_in_month
- DB
- delete_cookie
- delete_files
- directory_map
- do_hash
- doctype
- element
- elements
- ellipsize
- encode_php_tags
- entities_to_ascii
- entity_decode
- force_download
- form_button
- form_checkbox
- form_close
- form_dropdown
- form_error
- form_fieldset
- form_fieldset_close
- form_hidden
- form_input
- form_label
- form_multiselect
- form_open
- form_open_multipart
- form_password
- form_prep
- form_radio
- form_reset
- form_submit
- form_textarea
- form_upload
- get_auth_header
- get_categories_select
- get_clickable_smileys
- get_config
- get_cookie
- get_country_list
- get_dir_file_info
- get_file_info
- get_filenames
- get_instance
- get_language_select
- get_licences_select
- get_mime_by_extension
- gmt_to_local
- heading
- highlight_code
- highlight_phrase
- html_escape
- human_to_unix
- humanize
- img
- increment_string
- index_page
- is_false
- is_loaded
- is_php
- is_really_writable
- is_true
- js_insert_smiley
- lang
- link_tag
- load_class
- local_to_gmt
- log_message
- mailto
- mdate
- meta
- mysql_to_unix
- nbs
- nl2br_except_pre
- now
- octal_permissions
- ol
- parse_signed_request
- parse_smileys
- parseiOSversions
- plural
- prep_url
- quotes_to_entities
- random_element
- random_string
- read_file
- redirect
- reduce_double_slashes
- reduce_multiples
- remove_invisible_characters
- repeater
- safe_mailto
- sanitize_filename
- sec2min
- send_email
- set_checkbox
- set_cookie
- set_radio
- set_realpath
- set_select
- set_status_header
- set_value
- show_404
- show_comment
- show_error
- sign_hmac_sha1
- sign_rsa_sha1
- since
- singular
- site_url
- smiley_js
- standard_date
- strip_image_tags
- strip_quotes
- strip_slashes
- symbolic_permissions
- timespan
- timezone_menu
- timezones
- trim_slashes
- ul
- underscore
- unix_to_human
- uri_string
- url_title
- user
- user_favorite_list
- user_followed_list
- username
- valid_email
- validation_errors
- word_censor
- word_limiter
- word_wrap
- write_file
- xml_convert
- xss_clean