Any way to compress images |
[eluser]gvillavizar[/eluser]
Hello, In my site my users are uploading pictures, I can limit the file size they're uploading. Is there any way for me to reduce the file size from 1mb to, say 250kb? Thanks for your help.
[eluser]pistolPete[/eluser]
You can change the quality setting in the image manipulation class: http://ellislab.com/codeigniter/user-gui...e_lib.html
[eluser]gvillavizar[/eluser]
[quote author="pistolPete" date="1235592463"]You can change the quality setting in the image manipulation class: http://ellislab.com/codeigniter/user-gui...e_lib.html[/quote] Thanks for your reply. That worked like a charm. Another question, can I load the library more than once with different properties in the same controller. Like Code: if($photo1)
[eluser]pistolPete[/eluser]
Don't load it more than once. Use Code: $this->image_lib->clear(); Quote:The clear function resets all of the values used when processing an image. You will want to call this if you are processing images in a loop.
[eluser]gvillavizar[/eluser]
[quote author="pistolPete" date="1235596149"]Don't load it more than once. Use Code: $this->image_lib->clear(); Quote:The clear function resets all of the values used when processing an image. You will want to call this if you are processing images in a loop.[/quote] Perfect, thanks a lot for your help! That solved a lot! |
Welcome Guest, Not a member yet? Register Sign In |