![]() |
Image resize problems - 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: Image resize problems (/showthread.php?tid=11085) |
Image resize problems - El Forum - 08-25-2008 [eluser]louis w[/eluser] Having problems with the image lib and resizing images proportionally. This is my config: Code: $config['image_library'] = 'gd2'; When I do this and resize to 100 width, the width is 100, but the height is the original image size. I thought that maintain_ratio would scale the image proportionally? I did see this post, but I did not have a image_thumb, so not appropriate. http://ellislab.com/forums/viewthread/84992/ I almost want to do all the the new with/height logic myself, but feel it really should be built in. Image resize problems - El Forum - 08-25-2008 [eluser]steelaz[/eluser] Try changing $config['master_dim'] from 'auto' to 'width'; Image resize problems - El Forum - 08-25-2008 [eluser]louis w[/eluser] Tried that, $config['master_dim'] = 'width'; gives the same result. Image resize problems - El Forum - 08-25-2008 [eluser]steelaz[/eluser] Try setting height property to some small number, here is an example of what worked for me: Code: $config['image_library'] = 'gd2'; Image resize problems - El Forum - 08-26-2008 [eluser]louis w[/eluser] Nice one steelaz, that worked. Is that really how it is intended to work? Seems to me that if i wanted to fit an image proportionally into a certain width all i would need is the width and maintain_ratio. I might have to extended the image lib to make it a little easier to scale images. |