Welcome Guest, Not a member yet? Register   Sign In
URGENT: Image upload & resize issues
#5

[eluser]BrandonDurham[/eluser]
Okay, so I think I figured it out.

Because each dimension is not being divided equally (w/130 and h/150) then it's not accurate to say:
Code:
$crop_ratio = ($img_width >= $img_height) ? $img_height/150 : $img_width/130;
... because I'm not dividing by the same number, so they shouldn't be treated equally.

SO, I changed it to this and it's now working correctly:
Code:
$crop_ratio = (($img_width/130) > ($img_height/150)) ? $img_height/150 : $img_width/130;
$config['width'] = floor(130 * $crop_ratio);
$config['height'] = floor(150 * $crop_ratio);


Messages In This Thread
URGENT: Image upload & resize issues - by El Forum - 05-13-2008, 04:35 PM
URGENT: Image upload & resize issues - by El Forum - 05-14-2008, 08:15 AM
URGENT: Image upload & resize issues - by El Forum - 05-14-2008, 11:35 AM
URGENT: Image upload & resize issues - by El Forum - 05-14-2008, 11:49 AM
URGENT: Image upload & resize issues - by El Forum - 05-14-2008, 12:37 PM
URGENT: Image upload & resize issues - by El Forum - 05-14-2008, 12:51 PM
URGENT: Image upload & resize issues - by El Forum - 05-14-2008, 12:55 PM



Theme © iAndrew 2016 - Forum software by © MyBB