Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 290164

Summary: [Image Loading] ImageLoader cannot load JPEG files with CMYK color model
Product: [Eclipse Project] Platform Reporter: Mark McLaren <mark.k.mclaren>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: CLOSED WONTFIX QA Contact: Carolyn MacLeod <carolynmacleod4>
Severity: normal    
Priority: P3 CC: Silenio_Quarti
Version: 3.4.1Keywords: triaged
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard: stalebug
Attachments:
Description Flags
An example CMYK image none

Description Mark McLaren CLA 2009-09-22 14:20:17 EDT
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.14) Gecko/2009082707 Firefox/3.0.14 GTB5 (.NET CLR 3.5.30729)
Build Identifier: Using: org.eclipse.swt.win32.win32.x86_3.5.0.v3550b.jar

ImageLoader throws an exception if jpeg file uses CYMK color model.  See below for example snippet.

Reproducible: Always

Steps to Reproduce:
import org.eclipse.swt.graphics.ImageData;
import org.eclipse.swt.graphics.ImageLoader;

public class TestCmyk {
	public static void main(String[] args) {

		ImageLoader inLoader = new ImageLoader();
		ImageData[] result = inLoader.load("c:\\temp\\cmyk-example.jpg");
		System.out.println(result[0].width);
	}

}
Comment 1 Mark McLaren CLA 2009-09-22 14:22:43 EDT
Created attachment 147819 [details]
An example CMYK image

Attaching the jpeg file used by the description snippet
Comment 2 Carolyn MacLeod CLA 2011-10-04 17:26:55 EDT
Note that you can load a CMYK Image natively, using Image constructor, but you can't load a CMYK jpeg from stream or use ImageData constructor (which is what ImageLoaded uses). Hopefully, this partial solution will be useful to you.
Comment 3 Leo Ufimtsev CLA 2017-08-03 12:32:54 EDT
This is a one-off bulk update. (The last one in the triage migration).

Moving bugs from swt-triaged@eclipse to platform-swt-inbox@eclipse.org and adding "triaged" keyword as per new triage process:
https://wiki.eclipse.org/SWT/Devel/Triage

See Bug 518478 for details.

Tag for notification/mail filters:
@TriageBulkUpdate
Comment 4 Eclipse Genie CLA 2020-05-06 17:34:18 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.