I am trying to resize one edge of an image prior to cropping down to the final size. Here is what I have:

if ($height < $width) { // landscape
imageapi_image_scale($image,$width = 600);
}
if ($width < $height) { // portrait
imageapi_image_scale($image,$width = 200);
}
if ($height == $width) { // square
imageapi_image_scale($image,$width = 600);
}
return $image;

When height < $width, I am indeed seeing a resize of the width to 600. When $width < $height, I am not getting width to be resized to 200. Is there a syntax error somewhere?