Welcome Guest, Not a member yet? Register   Sign In
Image Resizing doesn't work [Solved]
#1

[eluser]catiaresende[/eluser]
Hi,

I need some help because I don't understand why the code doesn't resize uploaded images.
Actually I'm using GalleryCMS, so, I have the code to upload them, to create the thumbnail and, after that I added this code to resize:

Code:
function resize($fileName, $ext) {
        $mainimage = '../galeria/fotos/'.$fileName.'.'.$ext;
        
        list($width, $height, $type, $attr) = getimagesize($mainimage);
        
                
        $config['image_library'] = 'GD2';
        $config['source_image'] = $mainimage;
        $config['create_thumb'] = FALSE;
        $config['maintain_ratio'] = TRUE;
        $config['width'] = 400;
        $config['height'] = 400;

        $this->load->library('image_lib', $config);
        $this->image_lib->resize();
        if(!$this->image_lib->resize()) echo $this->image_lib->display_errors();
            
    }

Below the code to upload, I have this too:

Code:
$uploadImage = '../galeria/fotos/'.$newname;
            write_file($uploadImage, $file);
            $this->_createThumbnail($md5Date, $ext, $thumbWidth, $thumbHeight, $newname, $thumbname);
            $this->resize($md5Date, $ext, $thumbWidth, $thumbHeight, $newname, $thumbname);

        } else {
            $this->load->view('gallery_view');
        }

Any idea?
Greetings.


Messages In This Thread
Image Resizing doesn't work [Solved] - by El Forum - 01-14-2011, 02:26 PM
Image Resizing doesn't work [Solved] - by El Forum - 01-14-2011, 03:20 PM
Image Resizing doesn't work [Solved] - by El Forum - 01-14-2011, 08:30 PM
Image Resizing doesn't work [Solved] - by El Forum - 01-14-2011, 08:48 PM



Theme © iAndrew 2016 - Forum software by © MyBB