Image resize by width only |
[eluser]Random dude[/eluser]
I want my users to be able to choose from 3 sizes of images: small (200px width), med(500px width), large(800px width). I'm trying to use the image_lib to re-size images by setting width only, for example, if a user selects 'small', and uploads an image that's 1000px/900px, the image will be re-sized to 200px / (height adjusted automatically). In the 1000px/900px example, that would 200px / 180px. Right now if I set width to 200px, the height of the image stays the same. For example, 200px/900px. I'm not able to set height because users will be uploading many images of completely different sizes. What should I do?
[eluser]umefarooq[/eluser]
Hi in config keep Code: $config['maintain_ratio'] = TRUE; http://ellislab.com/codeigniter/user-gui...e_lib.html
[eluser]Random dude[/eluser]
Still not adjusting height automatically, here are my settings. Code: $config['image_library'] = 'GD2'; I think what I need is something like $config['height'] = "AUTO";
[eluser]Random dude[/eluser]
No I'm not, I just happened to name everything with swf_ because the files are coming from swfuploader.
[eluser]fRkSsK[/eluser]
hmm. i think it works. if code is: $config['maintain_ratio'] = TRUE; $config['width'] = 230; $config['height'] = 175; and if your photo w:1944 h:2592, it resize w:132 h:<b>175</b>. or your photo w:1200 h:623, it resize w:<b>230</b> h:120.
[eluser]fRkSsK[/eluser]
but i can not find <b>image_ratio_crop</b>. verot.net has image_ratio_crop. but i want to use CI upload class. i found someting http://ellislab.com/forums/viewthread/109434/. i think CI uploader class has not image ratio crop. has?
[eluser]fRkSsK[/eluser]
solution is http://ellislab.com/forums/viewthread/115336/. but CI default preferences isn't support image ratio crop.
[eluser]Udi[/eluser]
Lesson I learned lately while working with several Flash Uploaders: echo/print something back in the end of the uploading method - Mac users may have problems if you're not doing it. |
Welcome Guest, Not a member yet? Register Sign In |