Welcome Guest, Not a member yet? Register   Sign In
How to resize/crop different images to the same size?
#1

[eluser]Sinclair[/eluser]
Hi,

I have a codeigniter app that receives images with many different dimensions, but I need to show all this images in the website as 100*100. There are any helper that will help me to do this? I will need to maintain the ratio of the image.

There is any easy solution for this problem?

Best Regards,
#2

[eluser]sidscorner[/eluser]
You can't maintain the ratio of the image and have it 100x100 if it's not square (unless you meant max 100 by max 100). Check out the Image Manipulation Class in the Library.

You'll have to set $config['maintain_ratio'] = TRUE
#3

[eluser]Sinclair[/eluser]
Hi,

Thanks for the reply.

I know. I need to do a code that resize if the image is a square and if is not a square I will need to crop the image. This is the right way of doing this?

Best Regards,
#4

[eluser]JoostV[/eluser]
Almost...

1. if it's not square, then crop it to square.
2. resize it.

Feel free to use the image library that's in my autograph for this Smile
#5

[eluser]Sinclair[/eluser]
Thanks for your reply. I'am using it. It works very well.

Best Regards,
#6

[eluser]JoostV[/eluser]
Glad you like it. Spread the word Smile




Theme © iAndrew 2016 - Forum software by © MyBB