CodeIgniter Forums
The image copy routine failed - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: The image copy routine failed (/showthread.php?tid=11248)



The image copy routine failed - El Forum - 09-01-2008

[eluser]Martin_boatshop24[/eluser]
Any idea what would cause this error. I have searched through the image_lib.php but can't find this message in it. Is this message coming from the GD2 library. My php_error.log is not showing anything unusual but the line "The image copy routine failed" is showing in the codeIgniter log and there is nothing been displayed by the controller.


The image copy routine failed - El Forum - 09-01-2008

[eluser]Sumon[/eluser]
Would you please post your code for us.


The image copy routine failed - El Forum - 09-01-2008

[eluser]Martin_boatshop24[/eluser]
Yeah can do. Just a brief description all its meant to do it resize and output the image requested. Universe is library that contains a list of vars

Code:
class Images extends Controller {
    
    var $fullPath;
    
    function Images() {
        parent::Controller();
        $this->fullPath = $this->universe->site['resource_folder'] . "/" . $this->universe->site['clientImg_folder'] . "/";
        
    }
    
    function fetch( $for , $image ) {
    error_log("FOR ::: " . $for . " IMAGE ::: " . $image );
        switch ( $for ) {
            case "upload" :
                $resizerSettings = $this->config->item("thumbnail_resizer");
                $resizerSettings['source_image'] = $this->fullPath  . str_ireplace("_" , "/" , $image);
            break;
        }
        
        error_log( $resizerSettings['source_image'] );
        
        $this->load->library('image_lib' , $resizerSettings );
        $this->image_lib->resize();
        
    }
}



The image copy routine failed - El Forum - 09-01-2008

[eluser]Martin_boatshop24[/eluser]
dont worry fixed it


The image copy routine failed - El Forum - 09-02-2008

[eluser]Tommy_DK[/eluser]
It would be a help to me, if you could share your solution Smile
- I'm getting the same error message now


The image copy routine failed - El Forum - 09-04-2008

[eluser]Martin_boatshop24[/eluser]
The problem I had was that I had missed a load call i access the items in a config file without loading the config silly oversight on my part when I was debugging it. I believe the error relates to new_image setting. I have extended and alter this class so it doesn't work in excalty the same way as the standard library. If the the new_image setting isnt blank then it will try and copy the output of the image function called i.e. resize to the location and return this error.