39
39
import org .eclipse .swt .graphics .ImageData ;
40
40
import org .eclipse .swt .graphics .ImageDataProvider ;
41
41
import org .eclipse .swt .graphics .ImageFileNameProvider ;
42
- import org .eclipse .swt .graphics .SVGRasterizer ;
43
- import org .eclipse .swt .graphics .SVGRasterizerRegistry ;
44
42
45
43
/**
46
44
* An ImageDescriptor that gets its information from a URL. This class is not
@@ -61,15 +59,8 @@ public URLImageFileNameProvider(String url) {
61
59
public String getImagePath (int zoom ) {
62
60
URL tempURL = getURL (url );
63
61
if (tempURL != null ) {
64
- SVGRasterizer rasterizer = SVGRasterizerRegistry .getRasterizer ();
65
- if (rasterizer != null ) {
66
- try (InputStream in = getStream (tempURL )) {
67
- if (rasterizer .isSVGFile (in )) {
68
- return getFilePath (tempURL , false );
69
- }
70
- } catch (IOException e ) {
71
- // ignore.
72
- }
62
+ if (tempURL .toString ().endsWith (".svg" )) { //$NON-NLS-1$
63
+ return getFilePath (tempURL , false );
73
64
}
74
65
final boolean logIOException = zoom == 100 ;
75
66
if (zoom == 100 ) {
@@ -151,15 +142,8 @@ public ImageData getImageData(int zoom) {
151
142
private static ImageData getImageData (String url , int zoom ) {
152
143
URL tempURL = getURL (url );
153
144
if (tempURL != null ) {
154
- SVGRasterizer rasterizer = SVGRasterizerRegistry .getRasterizer ();
155
- if (rasterizer != null ) {
156
- try (InputStream in = getStream (tempURL )) {
157
- if (rasterizer .isSVGFile (in )) {
158
- return getImageData (tempURL , zoom );
159
- }
160
- } catch (IOException e ) {
161
- // ignore.
162
- }
145
+ if (tempURL .toString ().endsWith (".svg" )) { //$NON-NLS-1$
146
+ return getImageData (tempURL , zoom );
163
147
}
164
148
if (zoom == 100 ) {
165
149
return getImageData (tempURL , zoom );
0 commit comments