Welcome Guest, Not a member yet? Register   Sign In
An advanced image resize function with crop and without imagick
#1

[eluser]jayapalchandran[/eluser]
Hi,
I use codeigniters image resize function.
1. To crop it needs another library which will not be present in current shared web hosting.
2. The reason for cropping is assume the following situation.
a. I want to resize an uploaded image to 500x300.
b. i set the config as 500x300 and set maintain ration false; i get somewhat good picture but still it is very slightly distorted.
c. The distortion will not visible if the uploaded image is of a good resolution.
d. else you can see a little of shaky or blur effect.
e. if you resize it with maintain proportion true then you will not get around 500x300.
f. for example the result would be 472x300 or something like by maintaining the height value.
3. i want a formula to calculate at what width and height both the height and width are greater than 500x300 so that i can use that pixel in the config to resize and then crop it to 500x300.
4. once again i will tell you. at which assumed resize value will the resultant width and height will be more than 500x300 so that i can resize with the assumed width and height and then i will crop it so that i can get what i had expected.
finally some part of the image would have been removed cause of cropping...

and is there any cropping functionality available in CI other than using imagemagic...?

better i would like to try creating a new resize function... but for now i need one.
#2

[eluser]Flemming[/eluser]
have you seen tim thumb? It uses GD not image magic and creates your resized images on-the-fly OR retrieves them from cache if they've already been resized/cropped

http://www.darrenhoyt.com/2008/04/02/tim...-released/




Theme © iAndrew 2016 - Forum software by © MyBB