Skip to content

StackOverflowError in Image when auto-scaling differs from device zoom #2353

@ptziegler

Description

@ptziegler

To Reproduce

Run Snippet367 with -Dswt.autoScale=150.

Stacktrace:

Exception in thread "main" java.lang.StackOverflowError
	at org.eclipse.swt.internal.DPIUtil.getElementAtZoom(DPIUtil.java:289)
	at org.eclipse.swt.internal.DPIUtil.validateAndGetImageDataAtZoom(DPIUtil.java:260)
	at org.eclipse.swt.graphics.Image.initFromImageDataProvider(Image.java:797)
	at org.eclipse.swt.graphics.Image.<init>(Image.java:675)
	at org.eclipse.swt.internal.DPIUtil.autoScaleImageData(DPIUtil.java:156)
	at org.eclipse.swt.internal.DPIUtil.scaleImageData(DPIUtil.java:139)
	at org.eclipse.swt.graphics.Image.initFromImageDataProvider(Image.java:798)
	at org.eclipse.swt.graphics.Image.<init>(Image.java:675)
	at org.eclipse.swt.internal.DPIUtil.autoScaleImageData(DPIUtil.java:156)
	at org.eclipse.swt.internal.DPIUtil.scaleImageData(DPIUtil.java:139)
	at org.eclipse.swt.graphics.Image.initFromImageDataProvider(Image.java:798)
	at org.eclipse.swt.graphics.Image.<init>(Image.java:675)
...

Environment:

  1. Select the platform(s) on which the behavior is seen:
    • All OS
    • Windows
    • Linux
    • macOS

Version since

This is a regression introduced with 216f1ad.

Metadata

Metadata

Assignees

No one assigned

    Labels

    HiDPIIssues related to High resolution monitorsbugSomething isn't workingregressionSomething that used to work

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions