Welcome Guest, Not a member yet? Register   Sign In
how to generate exact same size thumbnail for different images in codeigniter
#4

[eluser]Michael Wales[/eluser]
Let's say you want all images to be 100 x 100:

Use a conditional to determine which dimension is the smallest, and resize by that dimension down to 100px. Then, crop the image down to 100px on the other dimension (offset by half the difference of the thumbnail's size and 100px - this will cause it to crop the center of the image).

The crop afterwards is to prevent the "squishy/stretchy" appearance if you enforce a particular size on both dimensions.


Messages In This Thread
how to generate exact same size thumbnail for different images in codeigniter - by El Forum - 06-30-2009, 12:07 PM



Theme © iAndrew 2016 - Forum software by © MyBB