crop the image in some image-editing program, however you would have to do your best to determine what the long and lat are at the edges of the photo- perhaps crop through some known landmark (49th parallel?) for which you can look up its co-ordinates. You need to know the longitude of both vertcal edges, and the latitude of both horizontal edges. Then replace some lines:
PHP Code:
$x = (($lon + 180) * ($width / 360));
$y = ((($lat * -1) + 90) * ($height / 180));
180 makes it so that the left edge gives 0, so you want to replace with the longitude value of the left edge of your picture (not including -)
360 is the width of the map in degrees so replace that with the number of degrees long your new map covers horizontally.
90 is the latitude of the top edge, replace that with the lat of the top edge of your new picture
The last 180 is the height in degrees, so replace that with the number of degrees long your new map covers vertically.
I think that should be it, it doesn't look like the second function needs modifying. Let me know how you get on!
Bookmarks