Hi
I've written an image resize script which works fine to re-scale an image to a fixed width or height whilst respecting the proportions
what i can't figure out is how to code it so that it will rescale the image to fit within a zone (like in Photoshop or Fireworks batches) - i keep going round in circles, lol
imagine that this is the simplified code :
function scaleToZone($old_w,$old_h,$zone_w,$zone_h){
$new_w = ?;
$new_h = ?;
}
where $zone_w and $zone_h are the maximum width and height of the zone
What would i need to put so that the image is scaled and both width and height fit in the zone but still keeping the proportions ?
thanks for any help you can give