⚠ In case you've missed it we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This forum is read-only and soon will be archived. ⚠

callback_after_upload + imgAreaSelect

callback imgareaselect crop

  • Please log in to reply
No replies to this topic

#1 Гэрэлт-Од Гоцбаяр

Гэрэлт-Од Гоцбаяр


  • Members
  • PipPip
  • 18 posts

Posted 28 February 2013 - 07:52 PM

How can I implement imgAreaSelect Plugin? User step is:


1. User upload image.

2. Some dialog with uploaded image will show up. Or without dialog, uploaded image will somehow appear.

3. User will use imgAreaSelect and choose how to crop.

4. Cropped image will stored into database.


Current code is (But it uses other library, I need imgAreaSelect):


public function news() {

        $this->grocery_crud->set_field_upload('image', 'assets/uploads/images');
        $this->grocery_crud->callback_after_upload(array($this, 'after_upload_pic'));
        $output = $this->grocery_crud->render();


public function after_upload_pic($uploader_response, $field_info, $files_to_upload) {
        $source_width = "";        //another question. How can I pass source width here?
        $source_height = "";       // how can i pass source height here?

        $file_uploaded = $field_info->upload_path . '/' . $uploader_response[0]->name;

        $this->md_image->crop_to_ratio($file_uploaded, $source_width, $source_height, '620px', '250px', 'assets/uploads/images/thumbs/');



I'm following http://ellislab.com/...wthread/121152/ this tutorial.

imgAreaSelect jQuery is here: http://odyniec.net/p.../imgareaselect/

If you don't get my idea, almost same question here: http://ellislab.com/...wthread/195177/

Also tagged with one or more of these keywords: callback, imgareaselect, crop

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users