CodeIgniter Forums
image cropping with codeigniter and escapeshellarg() error - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=11)
+--- Thread: image cropping with codeigniter and escapeshellarg() error (/showthread.php?tid=69130)



image cropping with codeigniter and escapeshellarg() error - codeigniter1932 - 10-12-2017

I want to upload an image with codeigniter and crop it. this is my source code:

                   $config['image_library'] = 'imagemagick';
                   $config['library_path'] = '/usr/X11R6/bin/';                        
                   $config['source_image'] = "./uploads/"."$userid"."/"."$image_name"; // image path
                   $config['new_image'] = "./uploads/"."$userid"."/".$upload_data['raw_name']."_thumb".$upload_data['file_ext']; // cropped image path
                   $config['maintain_ratio'] = false;
                   $config['width'] = $upload_data['image_width'];
                   $config['height'] = $upload_data['image_height'];
                   $config['x_axis'] = 10;
                   $config['y_axis'] = 10;
                   $this->load->library('image_lib');                      
                   $this->image_lib->initialize($config);

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

but i got this error: Message: escapeshellarg() has been disabled for security reasons

Filename: libraries/Image_lib.php

Line Number: 892

I test it on shared host, I ask my host provider about this problem and he said you have to buy a VPS.

I try GD2 instead of 'imagemagick' but it didn't work.

Please Help Me about this problem