Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tiff loader for tiffs with transparency #236

Open
akoch-yatta opened this issue Feb 10, 2025 · 0 comments
Open

Fix tiff loader for tiffs with transparency #236

akoch-yatta opened this issue Feb 10, 2025 · 0 comments
Labels
Bug A Derivation of Expected Behavior HiDPI A HiDPI-Related Issue or Feature SWT Issue for SWT
Milestone

Comments

@akoch-yatta
Copy link

akoch-yatta commented Feb 10, 2025

The Tiff loading seems to break when loading a tiff with included transparency, e.g. tiff_image.zip

Error

 org.eclipse.swt.SWTException: Unsupported color depth
	at org.eclipse.swt.SWT.error(SWT.java:4932)
	at org.eclipse.swt.SWT.error(SWT.java:4847)
	at org.eclipse.swt.SWT.error(SWT.java:4818)
	at org.eclipse.swt.internal.image.TIFFDirectory.parseEntries(TIFFDirectory.java:374)
	at org.eclipse.swt.internal.image.TIFFDirectory.read(TIFFDirectory.java:450)
	at org.eclipse.swt.internal.image.TIFFFileFormat.loadFromByteStream(TIFFFileFormat.java:65)
	at org.eclipse.swt.internal.image.FileFormat.loadFromStream(FileFormat.java:77)
	at org.eclipse.swt.internal.image.FileFormat.load(FileFormat.java:99)
	at org.eclipse.swt.graphics.ImageLoader.load(ImageLoader.java:154)
	at org.eclipse.swt.graphics.ImageLoader.load(ImageLoader.java:179)
	at org.eclipse.swt.graphics.ImageDataLoader.load(ImageDataLoader.java:29)
	at org.eclipse.swt.graphics.ImageData.<init>(ImageData.java:380)
	at org.eclipse.swt.graphics.Image$ImageFileNameProviderWrapper.getImageMetadata(Image.java:2147)
	at org.eclipse.swt.graphics.Image.getImageMetadata(Image.java:782)
	at org.eclipse.swt.graphics.Image.win32_getHandle(Image.java:821)
	at org.eclipse.swt.graphics.Image.createGdipImage(Image.java:1009)
	at org.eclipse.swt.graphics.GC.drawImage(GC.java:1026)
	at org.eclipse.swt.graphics.GC.drawImage(GC.java:1020)
	at org.eclipse.draw2d.SWTGraphics.drawImage(SWTGraphics.java:466)
	at org.eclipse.draw2d.ScaledGraphics.drawImage(ScaledGraphics.java:270)
	at org.eclipse.draw2d.Graphics.drawImage(Graphics.java:176)

Snippet to reproduce

public class Snippet1 {

public static void main (String [] args) {
	new ImageLoader().load("c:\\Users\\akoch\\Downloads\\tiff_image.tiff");
}
}
@akoch-yatta akoch-yatta converted this from a draft issue Feb 10, 2025
@akoch-yatta akoch-yatta added this to the 4.36 M3 milestone Feb 10, 2025
@akoch-yatta akoch-yatta added SWT Issue for SWT Bug A Derivation of Expected Behavior HiDPI A HiDPI-Related Issue or Feature labels Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A Derivation of Expected Behavior HiDPI A HiDPI-Related Issue or Feature SWT Issue for SWT
Projects
Status: 🔖 Ready: Atomic
Development

No branches or pull requests

1 participant