Welcome Guest, Not a member yet? Register   Sign In
image manipulation
#1

[eluser]ikim[/eluser]
Hello,

Im making an application where you upload a picture and then the app creates a thumbnail.

However, I want the thumbnail to come out as 85px by 85px.

The resize currently shrinks to longest side to 85px but then Im left with something like 85 by 100.

I know I must resize and then maybe crop the image but what is the best way of doing this?

Thanks
#2

[eluser]thachp[/eluser]
Have you try setting maintain_ratio preference to false?
Code:
$config['maintain_ratio'] = FALSE;
#3

[eluser]ikim[/eluser]
yeah but that distorts the image.

I would like to have it resize then cropped from the middle. But Ive been trying everything and cant seem to get it.

There are some posts about it but none of the codes does the job.

Anybody else have any suggestions?
#4

[eluser]Nanodeath[/eluser]
I'm confused. The resize shrinks the longest size to 85 pixels, and you end up with a 85x100 image? How is that physically possible?
#5

[eluser]ikim[/eluser]
That wasnt a true example. I was just trying to make a point that if a picture uploaded is a rectangle, it will remain a rectangle and not a 85px by 85px square.

If I dont use the mantain ratio, the image is then distorted and I dont want that. I just need to end up with a thumbnail that is a square and keeps the ratio.

My thoughts were to resize and then crop into a square but I cant seem to do that
#6

[eluser]marcoss[/eluser]
[quote author="ikim" date="1182902586"]My thoughts were to resize and then crop into a square but I cant seem to do that[/quote]

That's what you should do, how are you trying to acomplish that?
#7

[eluser]Crimp[/eluser]
The manual is slightly wrong on this. You need the width and height set for your crop() configs. That may do it for you. Also, if you take the width and height of your upload data array, you can figure out out the rest with / and * and proportions.
#8

[eluser]Lonely Angel[/eluser]
k
#9

[eluser]Lonely Angel[/eluser]
I want the thumbnail without to create a new image ... just to show this picture in web-site, but in small dimension (for more speed to loading .... )

Anybody can to help me ?
#10

[eluser]Lonely Angel[/eluser]
Can someone to help me?




Theme © iAndrew 2016 - Forum software by © MyBB