GD library |
[eluser]xwero[/eluser]
try this code (from php.net) Code: function LoadJpeg($imgname)
[eluser]Fatih[/eluser]
Ok. It is done. My image path was wrong. Code: $config['source_image'] = '/home/sevenly/public_html/ci/images/avatars/'.$this->upload->data('file_name'); I repaired this link and the problem solved. Thank you for all.
[eluser]ardinotow[/eluser]
Code: $config['source_image'] = '/home/sevenly/public_html/ci/images/avatars/'.$this->upload->data('file_name'); @fatigue. I also have the same problem. How to know the path of my htdocs folder on server like you provided above? thanks...
[eluser]Fatih[/eluser]
Hello ardinotov. If you use any simple ftp program (like as filezilla), you can find the right path on "remote site" box which your files storage on your server. Generally, if you use a apache server, your path should be : Code: /home/[username]/public_html/[installed ci]/[storage files]/ But, my file names were wrong in my case.
[eluser]Tom Glover[/eluser]
[quote author="ardinotow" date="1207593689"] Code: $config['source_image'] = '/home/sevenly/public_html/ci/images/avatars/'.$this->upload->data('file_name'); @fatigue. I also have the same problem. How to know the path of my htdocs folder on server like you provided above? thanks...[/quote] This has fixed my problem as well. Well I knew the htdocs folder.
[eluser]ardinotow[/eluser]
Code: $config['source_image'] = '/home/sevenly/public_html/ci/images/avatars/'.$this->upload->data('file_name'); If I try on local server how that path should be? I have tried these source image path below and I still got the same error message 'Your server does not support the GD function required to process this type of image' 1. Code: $config['source_image'] = 'G:\apache2triad\htdocs\advoria-ci-FA\advoria-assets\logo\'.$filename 2. Code: $config['source_image'] = '\advoria-assets\logo\'.$filename And, the other config are: Code: $config['image_library'] = 'GD2'; FYI, I use windows and apache2triad server environment. According to phpinfo, GD version is 2.0.28
[eluser]brownkow[/eluser]
Somebody correct me if I am wrong, but... You *could* just use the built-in php reserved variable of $_SERVER['DOCUMENT_ROOT']. This variable is set to the root directory of the site. http://uk2.php.net/reserved.variables
[eluser]ardinotow[/eluser]
Thanks brownkow....my problem has solved :cheese: I use this pattern to configure image source Code: $config['source_image'] = $_SERVER['DOCUMENT_ROOT'].'/advoria-ci-FA/'.$data['path_pic'].$filename; There are 4 segments in that pattern and here is the explanation: 1. Code: $_SERVER['DOCUMENT_ROOT'] Code: G:/apache2triad/htdocs 2. Code: /advoria-ci-FA/ 3. Code: $data['path_pic'] 4. Code: $filename After you have declared all configuration don't forget to add this code: Code: $this->load->library('image_lib', $config); So, my complete creating thumbnail code is: Code: $this->load->library('image_lib'); That's all, hope this little info can help someone :cheese:
[eluser]brownkow[/eluser]
Glad you got it working. I'm sure your code will help someone, I just hope we haven't thrown anybody off the CI path, because I would not be surprised if there was a CI equivalent. |
Welcome Guest, Not a member yet? Register Sign In |