x_terminat_or_3
asked on
Resize img with min/max + ratio
Hi all
IANAM (I am not a mathematician) and this is causing me some problems.
I need a function that scales down its input variables based on the min/max range
function imageResize(&$width,&$heig ht,$maxwid th,$maxhei ght)
{
}
I want that both width and height are in range AND
originalsize/originalwidth ~= newwidth/newheight
I tried first calculating width, and then decreasing that until width*ratio<=maxheight but that gives result way too low!
Good luck
Ramses aka x_terminat_or_3
IANAM (I am not a mathematician) and this is causing me some problems.
I need a function that scales down its input variables based on the min/max range
function imageResize(&$width,&$heig
{
}
I want that both width and height are in range AND
originalsize/originalwidth
I tried first calculating width, and then decreasing that until width*ratio<=maxheight but that gives result way too low!
Good luck
Ramses aka x_terminat_or_3
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Anyway, thanks for the link as well, but I cannot rely on GD being available so I 'cheat' by just setting the width/height attributes on the image tag.
With kind regards
Ramses