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.
If you know the size of the image beforehand, it is easy. Otherwise, it is hard to include the calculations within the process of the class since you will know the image dimensions only after it is uploaded.
I will see what I can do, and might actually implement a possibility to use XYWH besides TBLR.
I will see what I can do, and might actually implement a possibility to use XYWH besides TBLR.
PS: Thanks for the donation!