Bug 572899 - Move to Batik1.14
Summary: Move to Batik1.14
Status: CLOSED FIXED
Alias: None
Product: Sirius
Classification: Modeling
Component: Diagram (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 7.0.0   Edit
Assignee: Pierre-Charles David CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2021-04-16 03:03 EDT by Pierre-Charles David CLA
Modified: 2022-02-28 04:22 EST (History)
4 users (show)

See Also:


Attachments
Sample project with images of different types (incl. SVG) on a diagram (30.20 KB, application/zip)
2021-06-28 09:09 EDT, Pierre-Charles David CLA
no flags Details
Results of the rendering and export as different formts under Linux, for 2020-06 (Java 8) and 2021-06 (Java 11) (1.78 MB, application/zip)
2021-06-29 02:20 EDT, Pierre-Charles David CLA
no flags Details
Results of the rendering and export as different formats under Windows, for 2020-06 (Java 8) and 2021-06 (Java 11) (3.47 MB, application/x-zip-compressed)
2021-06-30 03:00 EDT, Laurent Redor CLA
no flags Details
Results of the rendering and export as different formats under macOS, for 2020-06 (Java 8) and 2021-06 (Java 11) (2.27 MB, application/zip)
2021-06-30 04:16 EDT, Maxime Porhel CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pierre-Charles David CLA 2021-04-16 03:03:32 EDT
Adopt Batik 1.14 via GMF Runtime 1.14 (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=572885).

For now we will do this on a specific branch based on v6.4.0 as this is the immediate need that triggered this effort, but once this is stabilized it will be merged on master for the next version of Sirius.
Comment 1 Eclipse Genie CLA 2021-06-28 09:02:23 EDT
New Gerrit change created: https://git.eclipse.org/r/c/sirius/org.eclipse.sirius/+/182541
Comment 2 Eclipse Genie CLA 2021-06-28 09:02:24 EDT
New Gerrit change created: https://git.eclipse.org/r/c/sirius/org.eclipse.sirius/+/182542
Comment 3 Pierre-Charles David CLA 2021-06-28 09:09:24 EDT
Created attachment 286696 [details]
Sample project with images of different types (incl. SVG) on a diagram
Comment 4 Pierre-Charles David CLA 2021-06-28 09:12:02 EDT
Steps to validate:

* Checkout the Sirius patch at https://git.eclipse.org/r/c/sirius/org.eclipse.sirius/+/182542
* Switch to 2020-06 target platform.
* Launch a runtime on a fresh/empty workspace, *with Java 8* as JRE (2020-06 is still compatible with Java 8).
* In the runtime's workspace, import the attached project.
* Open the project and the diagram inside.
* **Check** that all images (GIF, PNG, JPG and SVG) are "correctly" rendered, both on the diagram and in the outline.
  * In the outline there are some rendering artifacts, but this is not new.
* Change the zoom level and check the rendering:
  * Bitmap formats (GIF, PNG, JPG) should scale with artifacts.
  * The SVG image should still be crisp even when zooming.
  * Note that with a large enough zoom (e.g. 400%), the SVG image is not rendered at all. This is a known issue and not a regression; the cache used to stored the rendered version of the SVG is tool small in this case.
* Export the diagram in all supported formats: GIF, PNG, JPG, BMP and SVG.
  * Check outside of Eclipse that all formats are "correctly" exported. Some have known rendering issues and do not match exactly what is displayed in Eclipse, but again that is not a regression.
  * Check that the exported SVG matches the rendering in Eclipse. Note that the SVG image embedded in the diagram is exported as a bitmap, so it is expected that it is not crisp when zooming in the exported SVG file.
* In the Eclipse runtime, check which versions of org.apache.batik.* are present (using Help > About > Installation details)
  * With Eclipse 2020-06, you should see a mix of Batik 1.11 (used by the platform/e4) and Batik 1.14.
  * With Eclipse 2021-06, you should only see Batik 1.14.
  * On all platforms, you should never see any Batik components with versions 1.6, 1.9.x or 1.13.
* Repeat with 2021-06 target platform and Java 11.
Comment 5 Pierre-Charles David CLA 2021-06-29 02:20:54 EDT
Created attachment 286702 [details]
Results of the rendering and export as different formts under Linux, for 2020-06 (Java 8) and 2021-06 (Java 11)
Comment 6 Laurent Redor CLA 2021-06-30 03:00:44 EDT
Created attachment 286704 [details]
Results of the rendering and export as different formats under Windows, for 2020-06 (Java 8) and 2021-06 (Java 11)

Results of the rendering and export as different formats under Windows, for 2020-06 (Java 8) and 2021-06 (Java 11).

I noticed a problem on labels (not displayed on JPG and GIF). This label's problem occurs when the size is "max". It didn't occur when the image size is "nominal". I tested before the gerrit of this bugzilla and the problem was already here before:
* 2020-06/images-test.gif: size max, 528Ko, 11864x4209: problem with label
* 2021-06/images-test.gif: size nominal, 19,6Ko, 1426x506, no problem with label
Comment 7 Maxime Porhel CLA 2021-06-30 04:16:09 EDT
Created attachment 286705 [details]
Results of the rendering and export as different formats under macOS, for 2020-06 (Java 8) and 2021-06 (Java 11)
Comment 8 Pierre-Charles David CLA 2021-06-30 05:23:11 EDT
Thanks Laurent and Maxime.
All the issues mentioned seem unrelated to the SVG/Batik part, and more like problems that already existed before.
Comment 9 Laurent Redor CLA 2021-06-30 05:52:47 EDT
(In reply to Laurent Redor from comment #6)
> 
> I noticed a problem on labels (not displayed on JPG and GIF).

The cause of this problem is that diagram uses a Font (Linux Font) not available on my computer (Windows). If I replace the Font with an existing one, the problem disappears. This confirms that there is no link with Batik.
Comment 10 Eclipse Genie CLA 2021-07-09 04:49:43 EDT
New Gerrit change created: https://git.eclipse.org/r/c/sirius/org.eclipse.sirius/+/182939
Comment 11 Eclipse Genie CLA 2021-07-09 04:49:45 EDT
New Gerrit change created: https://git.eclipse.org/r/c/sirius/org.eclipse.sirius/+/182940
Comment 16 Eclipse Genie CLA 2021-07-20 11:18:23 EDT
New Gerrit change created: https://git.eclipse.org/r/c/sirius/org.eclipse.sirius/+/183201
Comment 18 Eclipse Genie CLA 2021-07-22 04:18:38 EDT
New Gerrit change created: https://git.eclipse.org/r/c/sirius/org.eclipse.sirius/+/183260
Comment 19 Arnaud Dieumegard CLA 2021-07-22 05:59:17 EDT
(In reply to Eclipse Genie from comment #18)
> New Gerrit change created:
> https://git.eclipse.org/r/c/sirius/org.eclipse.sirius/+/183260

These changes relates to a security-related problem on some diagrams. Security policy `NoLoadExternalResourceSecurity` do not allow for the use of svg images embedding images through the "<image>" tag. `EmbededExternalResourceSecurity` only allows for locally embedded resources which seems not to link to security leaks.
In addition, embedded images in svg's may be encoded using the `data` protocol for which we should add support.
Comment 21 Steve Monnier CLA 2022-02-01 20:53:36 EST
I only validated with Sirius 2021-06 target platform and Java 11, as Sirius 7.0.0.202201120736 or OD 12.0.0 dev is based on this platform version and java 11.
Comment 22 Pierre-Charles David CLA 2022-02-28 04:22:29 EST
Available in Sirius 7.0.0, see https://projects.eclipse.org/projects/modeling.sirius/releases/7.0.0