Welcome Guest, Not a member yet? Register   Sign In
image_create_gd
#10

(01-06-2017, 09:45 AM)Knutsford Wrote:
(01-06-2017, 09:25 AM)Narf Wrote: I don't understand how that shows anything or that it "has to be". You're not even showing how you're triggering image_create_gd() ...

Also, please use the code formatting provided by the forum; it's very hard to read your posts.

Sorry - the quick reply doesn't have formatting which was why. This is the code that should do the resize






Code:
if ($index >= $limit) { CONTINUE; }
            
            $image = str_replace(' ', '%20', $image);
            $image = str_replace('#', '%23', $image);
            if (strtolower(substr($image, -3)) == "png") {            
               $target = $this_dir . '/' . ++$index . '.png';
            }
            else {
                $target = $this_dir . '/' . ++$index . '.jpg';
            }
                
            if ($size == 'md') {
            
                // copy here
                copy($image, $target);
                // resize to 'md' size
                $resize_config['source_image'] = $target;
                $resize_config['new_image'] = $target;
                $resize_config['width'] = $dimensions['width'];
                $resize_config['height'] = $dimensions['height'];
                $resize_config['master_dim'] = 'width';
                
                $ci->image_lib->initialize($resize_config);
                
                if (!$ci->image_lib->resize()){
                
                   
                    $log_data = array(
                       'agent_id' => 0,
                       'status' => $ci->image_lib->display_errors(),
                       'error' => 1
                   );
               }
                       echo "kkk";




It is copying the image but not resizing it or carrying on and doing the next image in the array or creating the sm library or putting anything in the sm library
Reply


Messages In This Thread
image_create_gd - by Knutsford - 01-06-2017, 06:48 AM
RE: image_create_gd - by Narf - 01-06-2017, 07:08 AM
RE: image_create_gd - by Knutsford - 01-06-2017, 07:43 AM
RE: image_create_gd - by Narf - 01-06-2017, 07:50 AM
RE: image_create_gd - by Knutsford - 01-06-2017, 08:11 AM
RE: image_create_gd - by Narf - 01-06-2017, 08:28 AM
RE: image_create_gd - by Knutsford - 01-06-2017, 08:45 AM
RE: image_create_gd - by Narf - 01-06-2017, 09:25 AM
RE: image_create_gd - by Knutsford - 01-06-2017, 09:45 AM
RE: image_create_gd - by Knutsford - 01-06-2017, 09:50 AM
RE: image_create_gd - by Knutsford - 01-06-2017, 09:53 AM
RE: image_create_gd - by Narf - 01-06-2017, 09:51 AM



Theme © iAndrew 2016 - Forum software by © MyBB