class.upload.php is a powerful and mature PHP class to manage uploaded files, and manipulate images in many ways. The script is available under a GPL license.
I see what you mean. You will have to use the new dev version 0.27RC1. This version adds a parameter called image_precrop, which works as image_crop except that it crops the image before any resizing.
Here is how your code should look like with 0.27RC1:
Here is how your code should look like with 0.27RC1:
Note that you don't need any image_ratio... here, as your selected area will always be proportional to 197x70.