37 Messages
•
738 Points
Fri, Oct 25, 2019 3:00 PM
Photoshop transform scale float precision bug
There is an error in the displayed pixel size while using free transform on a smart object.
Demo PSD https://adobe.ly/364MsKW
Steps to reproduce:
This happens because as you see it's scaled by 14.29% which results in 100.3px.
700 * 0.1429 = 100.3
That means that rounding happens before the actual transform is applied or displayed (i hope its a UI error only)
100 / 700 = 0.1428571428571429 = 14.28571428571429%
700 * 14.28571428571429% = 100px
Why it is important?
There are NUMEROUS errors that can happen because of this float rounding/precision error.
Demo PSD https://adobe.ly/364MsKW
Steps to reproduce:
- Create shape rectangle 700*700px
- Make sure that it is on the rounded X,Y coordinates by entering Free Transform mode. (Ctrl/Cmd+T)
- Exit from Free Transform mode
- Convert rectangle to Smart Object
- Enter Free Transform mode again
- Switch the reference point to the top-left corner
- Right-click on the width and select Pixels, then do the same for height but set it to percents. We do this only to watch the bug - it doe not influence anything.
- Make sure that "Maintain Aspect Ratio" is ON
- Set the width to 100px
- Click on the height input field
- Now you see that instead of 100px you will have 100.03px in the width field.
This happens because as you see it's scaled by 14.29% which results in 100.3px.
700 * 0.1429 = 100.3
That means that rounding happens before the actual transform is applied or displayed (i hope its a UI error only)
100 / 700 = 0.1428571428571429 = 14.28571428571429%
700 * 14.28571428571429% = 100px
Why it is important?
There are NUMEROUS errors that can happen because of this float rounding/precision error.
- When you export images via Adobe Generator or regular export.
- When you set Snap Vector tools to pixel grid in the settings but the resulting scale is NOT snapped.
- When you resize raster imagery.
Problems
•
Updated
a year ago
18
1
Helpful Widget
How can we improve?
Tags
No tags available
Responses
max_johnson_7790531
Champion
•
626 Messages
•
14.6K Points
a year ago
0