Welcome Guest, Not a member yet? Register   Sign In
How to redirect user to the crop image?
#1

[eluser]Unknown[/eluser]
Hi, my application work like this:

User can view the uploaded image by other users. User have the option to crop the image before download (right click->save as).

My problem is:

1.How to redirect to the cropped image after user submit?
2.If other user also use the crop image function,the cropped image by other use will be replaced by new one. How to prevent this?

Thanks in advance. Newbie here.

This is my controller (upload.php):

Code:
function cropimage()
{

        $this->load->view('cropimage'); //cropimage

}

function do_cropimage()
{
        $this->load->model('upload_model');
        $this->upload_model->do_cropimage();
        $this->cropimage();

}

This is my model (upload_model.php):

Code:
function do_cropimage()
    {

        $source = "./uploads/images/Jellyfish.jpg";
        $des_path = "./uploads/images/convert/Jellyfish.jpg";


        //set image library configuration
        $config['image_library'] = 'imagemagick';
        $config['library_path'] = 'C:\imagemagick';
        $config['maintain_ratio'] = false;
        $config['source_image'] = $source;
        $config['new_image'] = $des_path;
        $config['x_axis'] = $this->input->post('x');
        $config['y_axis'] = $this->input->post('y');
        $config['width'] = $this->input->post('w');
        $config['height'] = $this->input->post('h');

        $this->load->library('image_lib', $config);


        if (!$this->image_lib->crop()) {
            echo $this->image_lib->display_errors();
        }


    }


Messages In This Thread
How to redirect user to the crop image? - by El Forum - 04-02-2010, 02:55 AM
How to redirect user to the crop image? - by El Forum - 04-02-2010, 03:47 AM
How to redirect user to the crop image? - by El Forum - 04-02-2010, 04:27 AM
How to redirect user to the crop image? - by El Forum - 04-18-2010, 05:02 PM



Theme © iAndrew 2016 - Forum software by © MyBB