Welcome Guest, Not a member yet? Register   Sign In
Getting name of resized image from image library
#1

[eluser]Thorpe Obazee[/eluser]
This is my method for uploading and then resizing. However, I need to get the name of the thumb image. How do I dynamically get the new name of the thumb image? Is there a function to get this in the image library? of course aside from doing the rename() php function.

Code:
function _upload_pics()
    {
        if ($_FILES)
        {
            $config = array(
                'upload_path'   => './uploads/',
                'allowed_types' => 'gif|jpg|png',
                'max_size'      => '100',
                'max_width'     => '400',
                'max_height'    => '400'
            );
            $this->load->library('upload', $config);

            if ( ! $this->upload->do_upload())
            {
                return FALSE;
            }
            else
            {
                $this->file = $this->upload->data();
                $config = array(
                    'image_library'  => 'gd2',
                    'source_image'   => './uploads/'.$this->file['file_name'],
                    'create_thumb'   => TRUE,
                    'maintain_ratio' => TRUE,
                    'width'          => 120,
                    'height'         => 120,
                    'new_image'      => './uploads/thumb/'.$this->file['file_name']
                );
                $this->load->library('image_lib', $config);
                $this->image_lib->resize();
                return TRUE;
            }
        } // if $_FILES
    }// End upload_pics


Messages In This Thread
Getting name of resized image from image library - by El Forum - 10-21-2008, 10:12 AM
Getting name of resized image from image library - by El Forum - 10-21-2008, 10:21 AM
Getting name of resized image from image library - by El Forum - 10-21-2008, 10:47 AM
Getting name of resized image from image library - by El Forum - 10-21-2008, 11:37 AM



Theme © iAndrew 2016 - Forum software by © MyBB