09-26-2024, 03:58 AM
The improved code just above had an error in it for about an hour after I posted it. If the lower right side of the clipped image is always square then you copied the buggy code. The code above has been corrected. Sorry for the confusion.