Bug 431075 - Add support for svgz images
Summary: Add support for svgz images
Status: CLOSED FIXED
Alias: None
Product: Sirius
Classification: Modeling
Component: Diagram (show other bugs)
Version: 1.0.0M7   Edit
Hardware: PC Windows 8
: P3 enhancement (vote)
Target Milestone: 3.0.0M6   Edit
Assignee: Jessy Mallet CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2014-03-25 01:14 EDT by Aurelien Pupier CLA
Modified: 2015-06-24 11:15 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Aurelien Pupier CLA 2014-03-25 01:14:18 EDT
svgz is a compressed format of svg.
Comment 1 Pierre-Charles David CLA 2014-03-25 09:01:00 EDT
From a quick test, it seems that if you rename your .svgz file as .svg, it will be correctly loaded. However a .svgz will not be recognized, and we try to load through SWT (instead of Batik), which causes a crash (Unrecognized file format). So the issue is only in the file name to decoder matching logic.
Comment 2 Pierre-Charles David CLA 2014-03-25 09:05:30 EDT
I see a lot of code with duplicate tests like this:

if (path != null && path.toUpperCase().endsWith(ImageFileFormat.SVG.getName())) {
  image = SVGWorkspaceImageFigure.flyWeightImage(path);
} else {
  image = WorkspaceImageFigure.flyWeightImage(path);
}

These tests should really be centralized in the factory methods in WorkspaceImageFigure instead of scattered all over the place in the code base. This should be done before the support for "svgz" file names, so that this change need only been done in that central place.

On a related note, it's really ugly that ImageFileFormat only exposes a name and requires all clients to do this kind of tests themselves.
Comment 3 Jessy Mallet CLA 2015-02-02 04:36:01 EST
currently working on it
Comment 4 Jessy Mallet CLA 2015-02-10 05:22:51 EST
wating for review : https://git.eclipse.org/r/#/c/41499/
Comment 6 Esteban DUGUEPEROUX CLA 2015-02-16 05:53:04 EST
Merged as 7d530c2cadeb2f2e6b6a9e777caf2774856d1a7c
Comment 7 Belqassim Djafer CLA 2015-04-10 09:42:09 EDT
Verified on Sirius 3.0.0M6
Comment 8 Pierre-Charles David CLA 2015-06-24 11:15:56 EDT
Available in Sirius 3.0.0. See https://wiki.eclipse.org/Sirius/3.0.0.