resize AND create thumb? |
[eluser]M4rc0[/eluser]
So I want to resize an image and also create a thumb of it The thing is that if I use: Code: $config['create_thumb'] = TRUE; I will only get mypic_thumb.jpg on the folder and not: - mypic.jpg - mypic_thumb.jpg which is what I need. What do you think is the correct way to get this? I was thinking of this: Code: function do_image() { But note the image_lib beeing called twice..this is not DRY :-S should I create the thumb on the fly instead?
[eluser]siubie[/eluser]
i think the problem is in calling image_lib twice try autoload the image_lib and use $this->image_lib->initialize($config); or maybe this topic will help : http://ellislab.com/forums/viewthread/105844/ ~siubie~
[eluser]M4rc0[/eluser]
Hi siubie! thanks for the reply! I'm sure the code above will work, but I wanted something more DRY and it's not about the image_lib beeing called twice, but using it twice..you know what I mean? isn't there a way of creating a thumb inside the do_image function, for example? how would you do this?
[eluser]Vicente Russo[/eluser]
You may create on the fly, OR implement your own resize-and-thumb-in-one-step. The actual CI's imagelib doesn't support 2 operations..
[eluser]M4rc0[/eluser]
Thanks for the replies. I believe on the fly is the best option. Thanks.
[eluser]stef25[/eluser]
im also trying to resize an image AND create thumbnail. what do you guys mean by creating a thumn "on the fly", how is this done? |
Welcome Guest, Not a member yet? Register Sign In |