Skip to content

Commit 8023fb8

Browse files
committed
changes
1 parent 5cbfa70 commit 8023fb8

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

modules/javafx.graphics/src/main/java/com/sun/javafx/iio/ImageStorage.java

+13-11
Original file line numberDiff line numberDiff line change
@@ -315,18 +315,20 @@ public static ImageFrame[] loadAll(String input, ImageLoadListener listener,
315315
}
316316

317317
if (theStream == null) {
318-
theStream = ImageTools.createInputStream(input);
319-
}
320-
321-
if (theStream == null) {
322-
DataURI dataUri = DataURI.tryParse(input);
323-
if (dataUri != null) {
324-
String mimeType = dataUri.getMimeType();
325-
if (mimeType != null && !"image".equalsIgnoreCase(dataUri.getMimeType())) {
326-
throw new IllegalArgumentException("Unexpected MIME type: " + dataUri.getMimeType());
318+
try {
319+
theStream = ImageTools.createInputStream(input);
320+
} catch (IOException ex) {
321+
DataURI dataUri = DataURI.tryParse(input);
322+
if (dataUri != null) {
323+
String mimeType = dataUri.getMimeType();
324+
if (mimeType != null && !"image".equalsIgnoreCase(dataUri.getMimeType())) {
325+
throw new IllegalArgumentException("Unexpected MIME type: " + dataUri.getMimeType());
326+
}
327+
328+
theStream = new ByteArrayInputStream(dataUri.getData());
329+
} else {
330+
throw ex;
327331
}
328-
329-
theStream = new ByteArrayInputStream(dataUri.getData());
330332
}
331333
}
332334

0 commit comments

Comments
 (0)