Bug 507056 - Diagram "export as image" resolution improvement
Summary: Diagram "export as image" resolution improvement
Status: CLOSED FIXED
Alias: None
Product: Sirius
Classification: Modeling
Component: Diagram (show other bugs)
Version: 4.1.0   Edit
Hardware: PC Linux
: P3 enhancement (vote)
Target Milestone: 5.0.0M7   Edit
Assignee: Cedric Brun CLA
QA Contact:
URL:
Whiteboard:
Keywords: noteworthy, triaged
Depends on:
Blocks:
 
Reported: 2016-11-04 11:15 EDT by Melanie Bats CLA
Modified: 2017-12-08 06:14 EST (History)
5 users (show)

See Also:


Attachments
small.jpg (192.46 KB, image/jpeg)
2016-11-16 09:22 EST, Cedric Brun CLA
no flags Details
withpatch-small.jpg (2.20 MB, image/jpeg)
2016-11-16 09:23 EST, Cedric Brun CLA
no flags Details
withpatch-wide.jpg (1.48 MB, image/jpeg)
2016-11-16 09:23 EST, Cedric Brun CLA
no flags Details
Compartiments.zip for the steps to reproduce (1.08 MB, application/x-zip-compressed)
2016-12-14 12:22 EST, Laurent Redor CLA
no flags Details
diag-5815-5575.jpg (867.62 KB, image/jpeg)
2016-12-14 12:24 EST, Laurent Redor CLA
no flags Details
diag-10-10.jpg (1.95 MB, image/jpeg)
2016-12-14 12:24 EST, Laurent Redor CLA
no flags Details
diag-10-10.jpg with patch4 (2.05 MB, image/jpeg)
2017-02-13 08:39 EST, Cedric Brun CLA
no flags Details
diag-5815-5575.jpg with patch4 (863.82 KB, image/jpeg)
2017-02-13 08:40 EST, Cedric Brun CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Melanie Bats CLA 2016-11-04 11:15:39 EDT
It should be possible to get a better resolution when exporting image from Sirius.
Comment 1 Laurent Redor CLA 2016-11-08 03:53:45 EST
Could you detail? Which format did you use?
Indeed, an improvement has already be done with bug 436579 for jpg format.
* example before bug 436579 : https://bugs.eclipse.org/bugs/attachment.cgi?id=243970
* example after bug 436579 : https://bugs.eclipse.org/bugs/attachment.cgi?id=243971
Comment 2 Eclipse Genie CLA 2016-11-16 06:13:59 EST
New Gerrit change created: https://git.eclipse.org/r/85123
Comment 3 Cedric Brun CLA 2016-11-16 09:22:42 EST
Created attachment 265373 [details]
small.jpg

An export without the patch (another diagram called "wide" is just not even exported because of the potential for an OOM error)
Comment 4 Cedric Brun CLA 2016-11-16 09:23:20 EST
Created attachment 265375 [details]
withpatch-small.jpg

With the patch applied on a fairly small (size-wise) diagram.
Comment 5 Cedric Brun CLA 2016-11-16 09:23:54 EST
Created attachment 265376 [details]
withpatch-wide.jpg

A "wide" diagram which gets correctly exported with the patch
Comment 6 Cedric Brun CLA 2016-11-16 09:27:15 EST
What we can see is that the size of the file is significantly increased as the resolution gets larger (there is no free lunch) though a "classic" diagram will end's up in the 1-2-3MB range whereas it used to be in the 200/300K range. That's an order of magnitude more (even if I would argue it should not be a problem in 2016) but that probably deserves the capability to control that when using the export by code and also a specific entry in the release notes.
Comment 7 Laurent Redor CLA 2016-12-14 12:22:10 EST
With the patch set 3 of the patch [1], there are remaining problems.

Steps to reproduce:
* Import project Compartiments (from Compartiments.zip)
* Open diagram "diag-10-10": {-10, -10} is the origin coordinates of the diagram
* Export this diagram as image (with the patch applied): KO, the result is a truncated diagram (see diag-10-10.jpg)
* Open diagram "diag-5815-5575": {-5815, -5575} is the origin coordinates of the diagram
* Export this diagram as image (with the patch applied): KO, the result is reduced diagram without the correct origin and size (see diag-5815-5575.jpg)

[1] https://git.eclipse.org/r/#/c/85123/3
Comment 8 Laurent Redor CLA 2016-12-14 12:22:42 EST
Created attachment 265885 [details]
Compartiments.zip for the steps to reproduce
Comment 9 Laurent Redor CLA 2016-12-14 12:24:26 EST
Created attachment 265886 [details]
diag-5815-5575.jpg
Comment 10 Laurent Redor CLA 2016-12-14 12:24:57 EST
Created attachment 265887 [details]
diag-10-10.jpg
Comment 11 Cedric Brun CLA 2017-02-13 08:38:43 EST
(In reply to Laurent Redor from comment #7)
> With the patch set 3 of the patch [1], there are remaining problems.
> 
> Steps to reproduce:
> * Import project Compartiments (from Compartiments.zip)
> * Open diagram "diag-10-10": {-10, -10} is the origin coordinates of the
> diagram
> * Export this diagram as image (with the patch applied): KO, the result is a
> truncated diagram (see diag-10-10.jpg)
> * Open diagram "diag-5815-5575": {-5815, -5575} is the origin coordinates of
> the diagram
> * Export this diagram as image (with the patch applied): KO, the result is
> reduced diagram without the correct origin and size (see diag-5815-5575.jpg)
> 
> [1] https://git.eclipse.org/r/#/c/85123/3

Thanks for this feeback, indeed the code was scaling X and Y starting positions and that could lead to clipping the wrong area, it was especially visible with negative positions.
Comment 12 Cedric Brun CLA 2017-02-13 08:39:43 EST
Created attachment 266785 [details]
diag-10-10.jpg with patch4
Comment 13 Cedric Brun CLA 2017-02-13 08:40:10 EST
Created attachment 266786 [details]
diag-5815-5575.jpg with patch4
Comment 15 Eclipse Genie CLA 2017-02-22 11:09:58 EST
New Gerrit change created: https://git.eclipse.org/r/91627
Comment 17 Cedric Brun CLA 2017-03-07 10:57:03 EST
We have several failures in CI environnement which are suggesting that we might be hitting OS specific limits with this algorithm. Reopening to investigate.
Comment 18 Eclipse Genie CLA 2017-03-08 08:57:06 EST
New Gerrit change created: https://git.eclipse.org/r/92613
Comment 20 Pierre-Charles David CLA 2017-04-05 09:24:51 EDT
I think we're done now. Cédric, feel free to reopen if I'm missing something.
Comment 21 Jessy Mallet CLA 2017-05-15 11:05:53 EDT
Validated with Sirius 5.0.0.201705121003
Comment 22 Pierre-Charles David CLA 2017-05-17 03:21:51 EDT
Verified by Jessy.
Comment 23 Pierre-Charles David CLA 2017-06-29 03:31:43 EDT
Available in Sirius 5.0.0, see https://wiki.eclipse.org/Sirius/5.0.0 for details.