Welcome Guest, Not a member yet? Register   Sign In
Image lib & looping
#1

[eluser]skylerrichter[/eluser]
When using the image_lib to crop or re-size images in a loop, $this->image_lib->clear(); does not reset the $width and $height values. Only the $orig_height and $orig_width values are reset causing unexpected results. Usualy the first width specified in the loop will carry threw out the loop.
#2

[eluser]cahva[/eluser]
http://codeigniter.com/bug_tracker/bug/9214/.

The clear method is incomplete. I too added a bugreport on similar case, which is because clear() doesnt clear enough Smile
#3

[eluser]haydenp[/eluser]
Yip, having the same issues! To fix this I did the following:

system/libraries/Image_Lib.php

I change row 108 in the clear() method

From:

Code:
$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');

To:

Code:
$props = array('source_folder', 'dest_folder', 'source_image', 'full_src_path', 'full_dst_path', 'new_image', 'width', 'height', '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');




Theme © iAndrew 2016 - Forum software by © MyBB