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

Bug 436579

Summary: Export as image quality for jpg format
Product: [Modeling] Sirius Reporter: Laurent Redor <laurent.redor>
Component: DiagramAssignee: Laurent Redor <laurent.redor>
Status: CLOSED FIXED QA Contact:
Severity: major    
Priority: P3 CC: maxime.porhel
Version: 0.9Keywords: triaged
Target Milestone: 2.0.0   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Quality with default compression (75)
none
Better quality (compression 100) none

Description Laurent Redor CLA 2014-06-04 09:26:18 EDT
Specific code has been added in org.eclipse.sirius.diagram.ui.tools.internal.part.SiriusFileFormat to change the default compression of jpg export. This code has been made with reflection to access to a private field. This code has been made for Eclipse Helios. But since this time, a fix has been done in SWT [1] for Eclipse 3.8 and 4.2.
The previous code does not work anymore for currently supported platform and must so be adapted.

With the default compression (75), some artifacts appear around labels for example.

1 - https://bugs.eclipse.org/bugs/show_bug.cgi?id=96320
Comment 1 Laurent Redor CLA 2014-06-04 09:27:50 EDT
It seems that we can now directly change the compression property of the ImageLoader (org.eclipse.swt.graphics). The specific SiriusFileFormat and SiriusImageLoader are no longer useful. This property can be directly changed in the method org.eclipse.sirius.diagram.ui.tools.api.part.DiagramEditPartService.saveToOutputStream(OutputStream, Image, ImageFileFormat, IProgressMonitor) if the imageFormat is JPG.
Warning: This change should be tested on all supported platform.
Comment 2 Laurent Redor CLA 2014-06-05 05:09:44 EDT
Created attachment 243970 [details]
Quality with default compression (75)
Comment 3 Laurent Redor CLA 2014-06-05 05:10:12 EDT
Created attachment 243971 [details]
Better quality (compression 100)
Comment 4 Laurent Redor CLA 2014-09-18 11:57:48 EDT
Proposition of solution: https://git.eclipse.org/r/33563

Tested on Juno3 platform
Comment 6 Laurent Redor CLA 2014-09-19 04:38:19 EDT
also checked on Luna by  Mickael Lanoe
Comment 7 Pierre-Charles David CLA 2014-10-27 06:53:00 EDT
Available in Sirius 2.0.0.