Page MenuHome

Fix T89868: Crash showing thumbnail of wide-aspect image
ClosedPublic

Authored by Jesse Yurkovich (deadpin) on Jul 17 2021, 9:12 PM.

Details

Summary

Scaling down images could create images with a width or height of zero.

Clamp at 1 to prevent a crash, also add an assert to scaling functions.


When attempting to scale a wide-aspect image like 4096x64 down to icon
sizes of 32x32 a scaling factor of 128 was calculated. This would result
in the final size being 32x0.5 and that 0.5 is truncated down to 0.

Clamp both dimensions to at least 1 now. The aspect ratio will not be
preserved for such images, but it's better than a crash.

Diff Detail

Repository
rB Blender
Branch
fixT89868 (branched from master)
Build Status
Buildable 15889
Build 15889: arc lint + arc unit

Event Timeline

Jesse Yurkovich (deadpin) requested review of this revision.Jul 17 2021, 9:12 PM
Jesse Yurkovich (deadpin) created this revision.
This revision was not accepted when it landed; it landed in state Needs Review.Jul 18 2021, 2:47 AM
This revision was automatically updated to reflect the committed changes.