• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
image manipulation


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?


Have you try setting maintain_ratio preference to false?
$config['maintain_ratio'] = FALSE;

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?

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?

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

[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?

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.

[eluser]Lonely Angel[/eluser]

[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 ?

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

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.