Open maRci002 opened 3 days ago
what do you want to do?
My server-side service applies filters to the image in the following order: Crop -> Flip -> Rotate.
My goal is to retrieve the crop area as if the image hadn’t been rotated or flipped.
For example, when I rotate the image to the left and want to crop the largest 16:9 ( when rotated it is actually 9/16 ) area, I currently get the following result:
{top: 0, left: 0, bottom: 414, right: 232.875}
The old method gave the same result, regardless of whether I rotated the image:
{top: 0, left: 0, bottom: 232.875, right: 414}
+-----------------------------+
| |
| |
| |
| |
| |
+-----------------------------+
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
+-----------------------------+
+-----------------+---------------------------------+
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
+-----------------+---------------------------------+
What is your actual intention? The previous algorithm and the current one differ in that the current version supports arbitrary angles, which has resulted in a change in the order. If the current version does not meet your needs, you may consider using an older version.
Content
The old cropping process was as follows:
Crop -> Flip -> Rotate
The new cropping process is:
Rotate -> Flip -> Crop
This means the current Crop Rect obtained via
getCropRect
is transformed by the flip and rotate operations. How can I retrieve the Crop Rect before any transformations are applied?I tried the old method, but it didn't give back the proper result: