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
{{ message }}
Repository navigation
StackOverflowError in Image when auto-scaling differs from device zoom #2353
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:
Select the platform(s) on which the behavior is seen:
changed the title [-]StackOverflowError when auto-scaling images on Linux[/-][+]StackOverflowError in Image when auto-scaling differs from device zoom[/+]on Jul 27, 2025
A similar issue can be reproduced on Windows, also as a result of this commit. For this, simply execute Issue0445_HiDPISmoothScaling when your device zoom is something other than 200%.
Exception in thread "main" java.lang.StackOverflowError
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:651)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:639)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
at org.eclipse.swt.graphics.GC.disposeOperations(GC.java:5968)
at org.eclipse.swt.graphics.GC.dispose(GC.java:5964)
at org.eclipse.swt.graphics.Image$ImageGcDrawerWrapper.newImageHandle(Image.java:2613)
at org.eclipse.swt.graphics.Image.getImageMetadata(Image.java:810)
at org.eclipse.swt.graphics.Image$ImageGcDrawerWrapper.newImageData(Image.java:2587)
at org.eclipse.swt.graphics.Image.getImageData(Image.java:1263)
at org.eclipse.swt.internal.DPIUtil.autoScaleImageData(DPIUtil.java:170)
at org.eclipse.swt.internal.DPIUtil.scaleImageData(DPIUtil.java:139)
at org.eclipse.swt.graphics.Image$BaseImageProviderWrapper.initializeHandleFromSource(Image.java:2292)
at org.eclipse.swt.graphics.Image$BaseImageProviderWrapper.newImageHandle(Image.java:2287)
at org.eclipse.swt.graphics.Image.getImageMetadata(Image.java:810)
at org.eclipse.swt.graphics.Image.win32_getHandle(Image.java:834)
at org.eclipse.swt.graphics.Image.createGdipImage(Image.java:858)
at org.eclipse.swt.graphics.GC.drawImage(GC.java:1201)
at org.eclipse.swt.graphics.GC$DrawImageToImageOperation.apply(GC.java:1194)
at org.eclipse.swt.graphics.GC.storeAndApplyOperationForExistingHandle(GC.java:5947)
at org.eclipse.swt.graphics.GC.drawImage(GC.java:1105)
at org.eclipse.swt.graphics.Image.drawScaled(Image.java:853)
at org.eclipse.swt.internal.DPIUtil$1.drawOn(DPIUtil.java:161)
at org.eclipse.swt.graphics.Image$ImageGcDrawerWrapper.newImageHandle(Image.java:2607)
at org.eclipse.swt.graphics.Image.getImageMetadata(Image.java:810)
at org.eclipse.swt.graphics.Image$ImageGcDrawerWrapper.newImageData(Image.java:2587)
at org.eclipse.swt.graphics.Image.getImageData(Image.java:1263)
at org.eclipse.swt.internal.DPIUtil.autoScaleImageData(DPIUtil.java:170)
at org.eclipse.swt.internal.DPIUtil.scaleImageData(DPIUtil.java:139)
...
Thank you for the report! We will have a look at this as soon as possible. The original code does also not seem fully sound to me, so let's see how we can properly fix it.
Activity
[-]StackOverflowError when scaling images on Linux[/-][+]StackOverflowError when auto-scaling images on Linux[/+][-]StackOverflowError when auto-scaling images on Linux[/-][+]StackOverflowError in Image when auto-scaling differs from device zoom[/+]ptziegler commentedon Jul 27, 2025
A similar issue can be reproduced on Windows, also as a result of this commit. For this, simply execute
Issue0445_HiDPISmoothScalingwhen your device zoom is something other than 200%.HeikoKlare commentedon Jul 28, 2025
Thank you for the report! We will have a look at this as soon as possible. The original code does also not seem fully sound to me, so let's see how we can properly fix it.
Fix stack overflow in DPIUtil.autoScaleImageData
Fix stack overflow in DPIUtil.autoScaleImageData eclipse-platform#2353
Fix stack overflow in DPIUtil.autoScaleImageData eclipse-platform#2353
Fix stack overflow in DPIUtil.autoScaleImageData eclipse-platform#2353
Fix stack overflow in DPIUtil.autoScaleImageData eclipse-platform#2353
Fix stack overflow in DPIUtil.autoScaleImageData #2353