summaryrefslogtreecommitdiffstats
path: root/system/libraries
diff options
context:
space:
mode:
authorMichael Dennis <michaeljdennis@gmail.com>2011-08-21 08:40:59 +0200
committerMichael Dennis <michaeljdennis@gmail.com>2011-08-21 08:40:59 +0200
commitcb07a322bee5c5b0a551ab959c7475a1a702ad03 (patch)
tree75b48e7607bcbd424d954bd0aaec2b7fcc1025c5 /system/libraries
parenta0672e1e1f8c5d633a4f0e985e3bcc876862933b (diff)
Fix for the Image_lib clear() function so that it resets all variables to their default values.
This should fix issues #157 and #174. https://github.com/EllisLab/CodeIgniter/issues/157 https://github.com/EllisLab/CodeIgniter/issues/174
Diffstat (limited to 'system/libraries')
-rw-r--r--system/libraries/Image_lib.php28
1 files changed, 25 insertions, 3 deletions
diff --git a/system/libraries/Image_lib.php b/system/libraries/Image_lib.php
index 8902f524d..6855e4498 100644
--- a/system/libraries/Image_lib.php
+++ b/system/libraries/Image_lib.php
@@ -104,15 +104,37 @@ class CI_Image_lib {
*/
function clear()
{
- $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');
+ $props = array('library_path', 'source_image', 'new_image', 'width', 'height', 'rotation_angle', 'x_axis', 'y_axis', 'wm_text', 'wm_overlay_path', 'wm_font_path', 'wm_shadow_color', 'source_folder', 'dest_folder', 'mime_type', 'orig_width', 'orig_height', 'image_type', 'size_str', 'full_src_path', 'full_dst_path');
foreach ($props as $val)
{
$this->$val = '';
}
- // special consideration for master_dim
- $this->master_dim = 'auto';
+ $this->image_library = 'gd2';
+ $this->dynamic_output = FALSE;
+ $this->quality = '90';
+ $this->create_thumb = FALSE;
+ $this->thumb_marker = '_thumb';
+ $this->maintain_ratio = TRUE;
+ $this->master_dim = 'auto';
+ $this->wm_type = 'text';
+ $this->wm_x_transp = 4;
+ $this->wm_y_transp = 4;
+ $this->wm_font_size = 17;
+ $this->wm_vrt_alignment = 'B';
+ $this->wm_hor_alignment = 'C';
+ $this->wm_padding = 0;
+ $this->wm_hor_offset = 0;
+ $this->wm_vrt_offset = 0;
+ $this->wm_font_color = '#ffffff';
+ $this->wm_shadow_distance = 2;
+ $this->wm_opacity = 50;
+ $this->create_fnc = 'imagecreatetruecolor';
+ $this->copy_fnc = 'imagecopyresampled';
+ $this->error_msg = array();
+ $this->wm_use_drop_shadow = FALSE;
+ $this->wm_use_truetype = FALSE;
}
// --------------------------------------------------------------------