Welcome Guest, Not a member yet? Register   Sign In
GD / Image_lib issues
#1

[eluser]stevefink[/eluser]
Does anyone happen to see what I'm doing wrong here? I'm trying to create thumbnails of images uploaded to my server using the Image_lib library with the following code:

Code:
function upload()
    {
        if($_FILES) {
            set_time_limit(30);

            $uploadDir = "uploads";

            $filename = ereg_replace("[^A-Za-z0-9.]", "",       $_FILES['Filedata']['name']);
            $uploadFile = $uploadDir . "/" . $filename;
            move_uploaded_file($_FILES['Filedata']['tmp_name'], $uploadFile);
            chmod($uploadFile, 0777);
            
            // let's create a thumbnail while we're here.
            $config['image_library'] = 'GD';
            $config['source_image'] = "$uploadFile";
            $config['create_thumb'] = TRUE;
            $config['maintain_ratio'] = TRUE;
            $config['width'] = 75;
            $config['height'] = 50;

            $this->load->library('image_lib', $config);
            $this->image_lib->resize();
            
            //$this->autodb->insert_photo($uploadFile);
            echo("This is complete!");
        }
        else
        {
            //$this->load->view('console/photos_view');
            die("Please contact the system administrator.");
        }
    }

The images get properly moved over to their respective directory. GD is also built into my PHP binary as verified via phpinfo(). No thumbnails are unfortunately being created though.

Can anyone suggest a way I can troubleshoot this as I'm not seeing any explicit errors that might imply something I'm doing incorrectly.

- sf


Messages In This Thread
GD / Image_lib issues - by El Forum - 08-21-2007, 05:58 PM
GD / Image_lib issues - by El Forum - 08-21-2007, 06:19 PM
GD / Image_lib issues - by El Forum - 08-21-2007, 06:22 PM
GD / Image_lib issues - by El Forum - 08-21-2007, 06:29 PM
GD / Image_lib issues - by El Forum - 08-22-2007, 01:48 AM
GD / Image_lib issues - by El Forum - 08-22-2007, 05:28 AM
GD / Image_lib issues - by El Forum - 08-22-2007, 06:29 AM
GD / Image_lib issues - by El Forum - 08-22-2007, 10:59 AM
GD / Image_lib issues - by El Forum - 08-22-2007, 11:11 AM



Theme © iAndrew 2016 - Forum software by © MyBB