Bug 525362 - Upgrade Batik version
Summary: Upgrade Batik version
Status: NEW
Alias: None
Product: Sirius
Classification: Modeling
Component: Diagram (show other bugs)
Version: 5.1.0   Edit
Hardware: PC All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Laurent Redor CLA
QA Contact: Guillaume Coutable CLA
URL:
Whiteboard:
Keywords: triaged
Depends on:
Blocks: 525506
  Show dependency tree
 
Reported: 2017-09-29 04:23 EDT by Laurent Redor CLA
Modified: 2018-06-28 10:26 EDT (History)
6 users (show)

See Also:


Attachments
projectWithSVG.zip (14.30 KB, application/x-zip-compressed)
2017-09-29 04:23 EDT, Laurent Redor CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Laurent Redor CLA 2017-09-29 04:23:36 EDT
Created attachment 270751 [details]
projectWithSVG.zip

Currently, Batik version used by Sirius (and by GMF) is version 1.6.0 (04/11/2010).
At least one bug exists with version 1.6.0 for Sirius that is probably fixed by version 1.7. The problem was discovered during analysis of bug 463051.
The viewBox attribute [1] is not implemented by the Batik 1.6 (only implemented since 1.7 [2]). So all SVG using viewBox can not be correctly resized when they are used as WorkspaceImage for node or container in Sirius.

If the version of Batik is changed, the commit efd3b969 [3] must be reverted and a particular attention must be done to diagrams containing SVG using viewBox. Indeed, in this kind of diagram, the visible size of the figure using SVG is not the same as what is stored in the GMF Model.
For example in project projectWithSVG (from projectWithSVG.zip), in the diagram 13, the node A has a GMF size of 140x80 pixels but the visible size is 140x140 pixels. So a migration participant will be probably necessary. This sample has been extracted from data of test org.eclipse.sirius.tests.unit.common.migration.DiagramMigrationTestCampaign02.

[1] https://www.sarasoueidan.com/blog/svg-coordinate-systems/#svg-viewbox
[2] https://svn.apache.org/viewvc/xmlgraphics/batik/trunk/CHANGES?revision=1787412&view=markup#l132
[3] http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=efd3b9696ba32572b6494bacfb51899cb2b2408a
Comment 1 Ed Willink CLA 2017-09-29 04:32:59 EDT
See Bug 522740. An upgrade to 1.9.0 is almost mandatory.
Comment 2 Pierre-Charles David CLA 2018-05-02 03:29:07 EDT
The patch at https://git.eclipse.org/r/c/117555/ includes the necessary changes. It's not merged yet as for now it requires depending on integration versions of Orbit and GMF Runtime (which may disappear at any point).
Comment 3 Eclipse Genie CLA 2018-05-16 07:52:23 EDT
New Gerrit change created: https://git.eclipse.org/r/122769
Comment 5 Pierre-Charles David CLA 2018-05-22 03:48:08 EDT
Fixed by 13a6fb3a253720a7ac8c69b117623a6dfacb1328.
Comment 6 Guillaume Coutable CLA 2018-05-25 05:15:25 EDT
Need further analysis as the node A is displayed with a size of 140x140 instead of the expected 140x80.
Comment 7 Laurent Redor CLA 2018-05-29 16:17:29 EDT
This issue has been marked as Resolved. But this is not the case, the new version of Batik is not enough.
I also tested to revert the commit pointed in initial description and the behavior is always KO (wrong resize with a SVG troncated).

This issue is removed from 6.0.0.
Comment 8 Eclipse Genie CLA 2018-05-31 05:55:31 EDT
New Gerrit change created: https://git.eclipse.org/r/123724
Comment 10 Eclipse Genie CLA 2018-06-04 13:06:26 EDT
New Gerrit change created: https://git.eclipse.org/r/123937