Thumbnail weirdness: resizing incorrectly - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: Thumbnail weirdness: resizing incorrectly (/showthread.php?tid=5532) |
Thumbnail weirdness: resizing incorrectly - El Forum - 01-25-2008 [eluser]gRoberts[/eluser] hi all, right, i'm using the image library and resize to generate thumbnails, and it seems that if the image is smaller then the given width and height, that it resizes it bigger. I tried putting in some code to check, but it's just prooven buggy. Code: public function generate($source, $output, $width, $height) { I have tried using an if/or on the width/height of the image. But I had an image that was wider then the given width, but shorter then the given height. This in turn copied the image. Basically i need to resize images whilst maintaining the ratio, to the size i've given, but if the image is already smaller then the height or width then I would like it to handle it correctly. Has anyone had this problem before? Thank you all in advance! Gavin |