= $image_height) { // Create the thumbnail $height = intval($image_height * $maxThumbDimension / $image_width); $command = "$cmd -size {$image_width}x$image_height $imagedir/$image -resize {$maxThumbDimension}x$height +profile \"*\" $target"; exec($command); rename($target,"$imagedir/$thumbnail"); } else { // Create the thumbnail $width = intval($image_width * $maxThumbDimension / $image_height); $command = "$cmd -size {$image_width}x{$image_height} $imagedir/$image -resize {$width}x{$maxThumbDimension} +profile \"*\" $target"; exec($command); rename($target,"$imagedir/$thumbnail"); } } ?>