Welcome Guest, Not a member yet? Register   Sign In
image resize problem
#1

[eluser]hamzakhan[/eluser]
myconfig file contain this code

Code:
$config['image_library'] = 'gd2';
$config['source_image'] = 'http://localhost/server/sscart/assets/images/catagory/mypic.jpg';
$config['create_thumb'] = TRUE;
$config['maintain_ratio'] = TRUE;
$config['width'] = 150;
$config['height'] = 150;


and i am calling the function to resize the image
$this->image_lib->resize();

loaded the library of image_lib
$autoload['libraries'] = array('image_lib');

but nothing happening.
#2

[eluser]John_Betong[/eluser]
[quote author="hamzakhan" date="1259765298"]myconfig file contain this code

Code:
$config['image_library'] = 'gd2';
$config['source_image'] = 'http://localhost/server/sscart/assets/images/catagory/mypic.jpg';
$config['create_thumb'] = TRUE;
$config['maintain_ratio'] = TRUE;
$config['width'] = 150;
$config['height'] = 150;


and i am calling the function to resize the image
$this->image_lib->resize();

loaded the library of image_lib
$autoload['libraries'] = array('image_lib');

but nothing happening.[/quote]
 
$config['source_image'] requires a path and not a URL
 
 
 
#3

[eluser]hamzakhan[/eluser]
here is my controller
Code:
<?php
/**
*
*  
*/
class Image extends Controller {
        
    function Image()
    {
        parent::Controller();
    }
    
    function index()
    {
        
        $this->load->library('image_lib');
$config['image_library'] = 'gd2';
$config['source_image'] = '/server/sscart/assets/images/catagory/mypic.jpg';
$config['create_thumb'] = TRUE;
$config['maintain_ratio'] = TRUE;
$config['width'] = 25;
$config['height'] = 25;

$this->image_lib->resize();


    }
}
?>

image is not resizing please help me
#4

[eluser]Ripe[/eluser]
Code:
$config['image_library'] = 'gd2';
$config['source_image'] = '/server/sscart/assets/images/catagory/mypic.jpg';
$config['create_thumb'] = TRUE;
$config['maintain_ratio'] = TRUE;
$config['width'] = 25;
$config['height'] = 25;
$this->load->library('image_lib', $config);
$this->image_lib->resize();

Try that.
#5

[eluser]hamzakhan[/eluser]
[quote author="Ripe" date="1259776953"]
Code:
$config['image_library'] = 'gd2';
$config['source_image'] = '/server/sscart/assets/images/catagory/mypic.jpg';
$config['create_thumb'] = TRUE;
$config['maintain_ratio'] = TRUE;
$config['width'] = 25;
$config['height'] = 25;
$this->load->library('image_lib', $config);
$this->image_lib->resize();

Try that.[/quote]



Nothing happening i tried your code like this
$this->load->library('image_lib');
$config['image_library'] = 'gd2';
$config['source_image'] = '/server/sscart/assets/images/catagory/mypic.jpg';
$config['create_thumb'] = TRUE;
$config['maintain_ratio'] = TRUE;
$config['width'] = 25;
$config['height'] = 25;
$this->load->library('image_lib', $config);
$this->image_lib->resize();
print "<pre>";
print_r($config);
print_r($this->image_lib);

no nothing happening from 3 hours.
#6

[eluser]Ripe[/eluser]
You don't need to load the library twice, remove the first line. If nothing happens then, check that source image actually exists.
#7

[eluser]John_Betong[/eluser]
&nbsp;
From the User Guide:
Code:
// A good practice is use the processing function conditionally, showing an error upon failure, like this:
if ( ! $this->image_lib->resize())
{
    echo $this->image_lib->display_errors();
}
&nbsp;
&nbsp;
&nbsp;
#8

[eluser]hamzakhan[/eluser]
Code:
$config['image_library'] = 'gd2';
$config['source_image'] = 'assets/images/catagory/mypic.jpg';
$config['create_thumb'] = TRUE;
$config['maintain_ratio'] = TRUE;
$config['width'] = 25;
$config['height'] = 25;
$this->load->library('image_lib', $config);
$this->image_lib->resize();
print "<pre>";
print_r($config);
print_r($this->image_lib);        

is the correct path now
$config['source_image'] = 'assets/images/catagory/mypic.jpg';
i am using the wrong one path
Code:
$config['source_image'] = 'server/sscart/assets/images/catagory/mypic.jpg';

extreamly so much thank u
for the solution
now its working perfectly.
if i am in your country or in nabour then i definitely give a party to you
because i am bothering from 3 hours and few min/
god bless you my friends.




Theme © iAndrew 2016 - Forum software by © MyBB