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

Bug 119662

Summary: Exporting gradient image using ImageLoader causes loss of detail (Linux only)
Product: [Eclipse Project] Platform Reporter: Steven R. Shaw <steveshaw>
Component: SWTAssignee: Carolyn MacLeod <carolynmacleod4>
Status: RESOLVED WORKSFORME QA Contact:
Severity: normal    
Priority: P3 CC: tmacdoug, xixiyan
Version: 3.2Keywords: triaged
Target Milestone: ---   
Hardware: PC   
OS: Linux-GTK   
Whiteboard:
Attachments:
Description Flags
Image file to be loaded as a Image to reproduce the defect. none

Description Steven R. Shaw CLA 2005-12-07 10:36:02 EST
Use following code with attached image after loading it as an Image (img).

ImageLoader imageLoader = new ImageLoader();
ByteArrayOutputStream byteOS = new ByteArrayOutputStream();
imageLoader.data = new ImageData[] {img.getImageData()};
imageLoader.logicalScreenHeight = img.getBounds().width;
imageLoader.logicalScreenHeight = img.getBounds().height;
imageLoader.save(byteOS, SWT.IMAGE_GIF); // or JPEG

Observe that exported image has lost detail of gradient.  This doesn't happen on Windows.
Comment 1 Steven R. Shaw CLA 2005-12-07 10:38:12 EST
Created attachment 31302 [details]
Image file to be loaded as a Image to reproduce the defect.

Image file to be loaded as a Image to reproduce the defect.
Comment 2 Xi Yan CLA 2018-07-13 12:10:18 EDT
I cannot reproduce the issue on GTK3.22. Please reopen this ticket if the issue reoccurs.