Bounding Box Dimensions
Objectives
- To get the exact bounds values for text layers from the api
- But as we couldn’t find the exact values shown in the Transform section of PS from batchplay api we formed our own calculation with the available values.
Approaches
- Extracted property called textKey using batchplay command, where we had a bounds key which contains top, bottom, left and right.
- And also had transform key which contains xx, xy, yx, yy so the equation we formed to the actual width and height of the text layers
Width = (right - left) * xx
Height = (bottom - top) * yy
Problems
- So the Width and Height is fine now. But the x and y coordinates we are using the bounds from the layer itself. But it had slight variations in Y values for around 10 - 20px.
- The values from textKey are not around the ones showing in the app.
- So if we can get the exact x and y coordinates or which ones should we rely on for the precise values.
Any insights or suggestions would be greatly appreciated!