Welcome Guest, Not a member yet? Register   Sign In
help with image_lib resize()
#1

[eluser]matches[/eluser]
Hi,

Can I get some help with the image resize method?

I am getting the following error:

Fatal error: Call to a member function resize() on a non-object

Thanks for any help.
Code:
<?php
                foreach($query as $row):
                    $path = APPPATH . "agent_property_images/ianseabock/Alameda/436_Taylor";
                    $dir_handle = @opendir($path) or die("Unable to open folder");
                    
                    while (false !== ($file = readdir($dir_handle))) {
                        
                        if($file == "index.php")
                        continue;
                        if($file == ".")
                        continue;
                        if($file == "..")
                        continue;
                        
                        $config['image_library'] = 'gd2';
                        $config['source_image']    = 'http://localhost/sfbaoh/' . $path . '/' . $file;
                        $config['create_thumb'] = TRUE;
                        $config['maintain_ratio'] = TRUE;
                        $config['width'] = 75;
                        $config['height'] = 50;
                        
                        $this->load->library('image_lib', $config);
                        
                        //THIS IS THE LINE THROWING THE ERROR
                        $this->image_lib->resize();
                    
                    }
                    closedir($dir_handle);
                    echo $row->address_1;
                    echo $row->address_2;
                    echo $row->city; echo $row->state; echo $row->zip;
                endforeach; ?>
#2

[eluser]toopay[/eluser]
Where you put this code? Controller, Helper, Library, View?
#3

[eluser]matches[/eluser]
This is in the view. I know it shouldn't be, but it was the best I could do at the moment. I just wanted to get it working and I would come up with a better solution later.
#4

[eluser]toopay[/eluser]
Put that into your controller!!!




Theme © iAndrew 2016 - Forum software by © MyBB