You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Resizing perfectly square image using methods resizeToWidth(), resizeToHeight(), resizeToBestFit(), resizeToShortSide() and resizeToLongSide() is supposed to always produce image with the same width and height, but its not always the case because one of the size values is ratio scaled and then rounded down to lowest integer value via (int) cast conversion.
The easiest solution is to round scaled float value to closest integer value before type conversion. Ideally ratio scaling should be skipped completely when source width and height values are equal.
The text was updated successfully, but these errors were encountered:
Resizing perfectly square image using methods resizeToWidth(), resizeToHeight(), resizeToBestFit(), resizeToShortSide() and resizeToLongSide() is supposed to always produce image with the same width and height, but its not always the case because one of the size values is ratio scaled and then rounded down to lowest integer value via (int) cast conversion.
The easiest solution is to round scaled float value to closest integer value before type conversion. Ideally ratio scaling should be skipped completely when source width and height values are equal.
The text was updated successfully, but these errors were encountered: