Welcome Guest, Not a member yet? Register   Sign In
saving external image and creating thumbnail locally problem
#6

[eluser]lexusgs430[/eluser]
Ok so I got the save to server working, now in a seperate function call, I am trying to resize the image. What is strange is, I am referencing the image URL using relative, and its working fine to display the current image on the controller (the same image I am trying to resize), but on when the image_thumb function is called it doesent throw any errors, but also does not resize. and I also put in a return the image address call at the bottom, which is not recognizing the path to the image correctly. So ya, was hoping you could take a look at it now.

Code:
function image_thumb($image_url, $height, $width)
{
    // Get the CodeIgniter super object
    $CI =& get_instance();

    // Path to image thumbnail




    if( ! file_exists($image_url))
    {
        
        // LOAD LIBRARY
        $CI->load->library('image_lib');

        // CONFIGURE IMAGE LIBRARY
        $config['image_library']    = 'gd2';
        $config['source_image']        = $image_url;
        $config['maintain_ratio']    = TRUE;
        $config['height']            = $height;
        $config['width']            = $width;
        $CI->image_lib->initialize($config);
        $CI->image_lib->resize();
        $CI->image_lib->clear();
    }

    return "<img src='".$image_url."' />";
}

Also, in the if file exists I put an echo "true", to see if it was getting to that part of the function or not, and it was echoing true. Which I would think would make the function work. But ya any help appreciated in advance.


Messages In This Thread
saving external image and creating thumbnail locally problem - by El Forum - 06-21-2010, 05:29 PM



Theme © iAndrew 2016 - Forum software by © MyBB