I'm trying to make thumbmails of user imaes. However, I always get 'path to the image is incorrect."
my code:
$settings = array(
'source_image' => '/videotuts/profilepic/userimg.png',
'create_thumb' => TRUE,
'new_image' => '/videotuts/profilepic'
);
$this->load->library('image_lib',$settings);
$r = $this->image_lib->resize();
Does it matter that codeigniter is not installed in my website root?
Looking at all the answers and comments, let me assume that you have codeigniter in folder /htdocs/videotuts/
, notice there is a /
in the starting. So you index.php
is located in htdocs/videotuts/index.php
. Codeigniter libraries will follow any path respective to index.php
and hence there should be a path /videotuts/profilepic/userimg.png
under /htdocs/videotuts/
or the full path should be '/htdocs/videotuts/videotuts/profilepic/userimg.png'. If its not the same, remove the unwanted folder name from your paths. You don't need to use APPPATH
or FCPATH
or BASEPATH
. 2ndly, if you are creating thumbnails, I hope you have correctly set read write perms for image folders.
Is that folder actually at that absolute path on your server? If not, experiment with using the APPPATH constant.
'source_image' => APPPATH.'videotuts/profilepic/userimg.png',
If you are using CI 2.0.2, your APPPATH is application folder. You should use FCPATH, try this:
'source_image' => FCPATH.'videotuts/profilepic/userimg.png',