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

[eluser]misterdonut[/eluser]
Code:
function resize($path)
    {
        $this->load->library('image_lib');

        $config_upload['image_library'] = 'gd2';
        $config_upload['source_image'] = $path;
        $config['maintain_ratio'] = TRUE;
        $config['width'] = 700;
        $config['height'] = 500;

        $this->load->library('image_lib', $config);

        $this->image_lib->resize();

    }


my images won't resize
the upload are working.

and another question.
how come the upload image are giving me
C:/xampp/htdocs/pics/uploads/dragonwallpaper.jpg

and not using my base_url?

is gd2 pre-installed in CI? or should i download one? if so where should i put it?

TIA
#2

[eluser]Flemming[/eluser]
This is not entirely the answer you were looking for but it *may* help you...

First, yes you need GD installed on your server for any resizing. Or you can use ImageMagick instead, but GD is more commonly installed I believe - so first off, find out if it's installed on your server. It is NOT part of CI - it is a PHP module. If in doubt, run a phpinfo() script on your server, that will tell you if GD or ImageMagick are installed.

Next - consider using something like this for thumbnails instead: http://www.darrenhoyt.com/2008/04/02/tim...-released/

It still depends on GD, no getting around that unfortunately. But it is a very quick, efficient, easy-to-implement, flexible solution for resizing and cropping images.

HTH !




Theme © iAndrew 2016 - Forum software by © MyBB