Click here to Skip to main content
15,881,089 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello! There is my function:

PHP
<? function resize_image($path, $path_image)
   {
       $CI = & get_instance();

       $config = array();

       $config['image_library'] = 'ImageMagick';
       $config['source_image'] = $path; //full path
       $config['new_image'] = $path_image.'new_image.jpg';
       $config['create_thumb'] = TRUE; // ставим флаг создания эскиза
       $config['maintain_ratio'] = TRUE; // сохранять пропорции
       $config['width']     = 200; // и задаем размеры
       $config['height']   = 200;

       $CI->load->library('image_lib');
       $CI->image_lib->initialize($config);

           if ( ! $CI->image_lib->resize())
           {
               echo $CI->image_lib->display_errors();
               die();
           }
           $CI->image_lib->clear();



   }?>


I try to make thumb image by library ImageMagick, but i get error:
The path to your image library is not correct. Please set the correct path in your image preferences.
How fix it?
Posted
Comments
Richard C Bishop 6-May-13 10:09am    
I would say providing the correct path should do the trick.
Jardin1 6-May-13 15:21pm    
Where i can set it correct path?
Mohibur Rashid 6-May-13 23:51pm    
when you call resize_image function then
Prasad Khandekar 7-May-13 11:20am    
May be there is a better way. Please refer to this manual (http://www.php.net/manual/en/imagick.examples-1.php)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900