CodeIgniter Forums
Resize with crop and spaces - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: Resize with crop and spaces (/showthread.php?tid=68217)



Resize with crop and spaces - GoldenFingers - 06-11-2017

hi, 
i want to ask how can i do like this through codeigniter

"Crop keep proportions but outputting a fixed size
Image is cropped as above, but the output is padded to fit the specified size. Please note I set a funny background colour for visual reasons only"

in this library
http://www.matmoo.com/digital-dribble/codeigniter/image_moo/


can i do this with codeigniter only without using external library ??


RE: Resize with crop and spaces - rtenny - 06-12-2017

Download the library and only use the function for the crop and resize. As you dont need any of the other features there is no point in using the entire library. The library also uses standard php function just make it easier and more flexible if you need to a lot of other image manipulation.


RE: Resize with crop and spaces - rtenny - 06-12-2017

If you use the code from the function resize_crop($mw,$mh)
you should be able to get want you want.