Index: trunk/src/org/openstreetmap/josm/tools/ImageProvider.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/ImageProvider.java	(revision 4259)
+++ trunk/src/org/openstreetmap/josm/tools/ImageProvider.java	(revision 4261)
@@ -58,5 +58,7 @@
 
     public static enum ImageType {
-        PNG, SVG
+        SVG,    // scalable vector graphics
+        OTHER   // everything else, e.g. png, gif
+                // must be supported by Java
     }
 
@@ -89,5 +91,5 @@
         ImageIcon icon = getIfAvailable(subdir, name);
         if (icon == null) {
-            String ext = name.indexOf('.') != -1 ? "" : ".png";
+            String ext = name.indexOf('.') != -1 ? "" : ".???";
             throw new NullPointerException(tr(
             "Fatal: failed to locate image ''{0}''. This is a serious configuration problem. JOSM will stop working.",
@@ -152,5 +154,5 @@
         if (name == null)
             return null;
-        ImageType type = name.toLowerCase().endsWith("svg") ? ImageType.SVG : ImageType.PNG;
+        ImageType type = name.toLowerCase().endsWith(".svg") ? ImageType.SVG : ImageType.OTHER;
 
         if (name.startsWith("http://")) {
@@ -171,49 +173,58 @@
         }
         String[] extensions;
-        if (name.toLowerCase().endsWith(".png") | name.toLowerCase().endsWith(".svg")) {
+        if (name.indexOf('.') != -1) {
             extensions = new String[] { "" };
         } else {
             extensions = new String[] { ".png", ".svg"};
         }
-        for (String ext : extensions) {
-            if (".svg".equals(ext)) {
-                type = ImageType.SVG;
-            } else if (".png".equals(ext)) {
-                type = ImageType.PNG;
-            }
-            
-            String full_name = subdir + name + ext;
-            String cache_name = full_name;
-            /* cache separately */
-            if (dirs != null && dirs.size() > 0) {
-                cache_name = "id:" + id + ":" + full_name;
-                if(archive != null) {
-                    cache_name += ":" + archive.getName();
+        final int ARCHIVE = 0, LOCAL = 1;
+        for (int place : new Integer[] { ARCHIVE, LOCAL }) {
+            for (String ext : extensions) {
+
+                if (".svg".equals(ext)) {
+                    type = ImageType.SVG;
+                } else if (".png".equals(ext)) {
+                    type = ImageType.OTHER;
                 }
-            }
-
-            ImageWrapper iw = cache.get(cache_name);
-            if (iw != null) return iw;
-
-            if (archive != null) {
-                iw = getIfAvailableZip(full_name, archive, type);
-                if (iw != null) {
-                    cache.put(cache_name, iw);
-                    return iw;
+
+                String full_name = subdir + name + ext;
+                String cache_name = full_name;
+                /* cache separately */
+                if (dirs != null && dirs.size() > 0) {
+                    cache_name = "id:" + id + ":" + full_name;
+                    if(archive != null) {
+                        cache_name += ":" + archive.getName();
+                    }
                 }
-            }
-
-            // getImageUrl() does a ton of "stat()" calls and gets expensive
-            // and redundant when you have a whole ton of objects. So,
-            // index the cache by the name of the icon we're looking for
-            // and don't bother to create a URL unless we're actually
-            // creating the image.
-            URL path = getImageUrl(full_name, dirs);
-            if (path == null)
-                continue;
-            iw = getIfAvailableLocalURL(path, type);
-            if (iw != null) {
-                cache.put(cache_name, iw);
-                return iw;
+
+                ImageWrapper iw = cache.get(cache_name);
+                if (iw != null) return iw;
+
+                switch (place) {
+                    case ARCHIVE:
+                        if (archive != null) {
+                            iw = getIfAvailableZip(full_name, archive, type);
+                            if (iw != null) {
+                                cache.put(cache_name, iw);
+                                return iw;
+                            }
+                        }
+                        break;
+                    case LOCAL:
+                        // getImageUrl() does a ton of "stat()" calls and gets expensive
+                        // and redundant when you have a whole ton of objects. So,
+                        // index the cache by the name of the icon we're looking for
+                        // and don't bother to create a URL unless we're actually
+                        // creating the image.
+                        URL path = getImageUrl(full_name, dirs);
+                        if (path == null)
+                            continue;
+                        iw = getIfAvailableLocalURL(path, type);
+                        if (iw != null) {
+                            cache.put(cache_name, iw);
+                            return iw;
+                        }
+                        break;
+                }
             }
         }
@@ -227,10 +238,10 @@
                     new File(Main.pref.getPreferencesDir(), "images").toString());
             switch (type) {
-                case PNG:
-                    img = Toolkit.getDefaultToolkit().createImage(is.getFile().toURI().toURL());
-                    break;
                 case SVG:
                     URI uri = getSvgUniverse().loadSVG(is, is.getFile().toURI().toURL().toString());
                     img = createImageFromSvgUri(uri);
+                    break;
+                case OTHER:
+                    img = Toolkit.getDefaultToolkit().createImage(is.getFile().toURI().toURL());
                     break;
             }
@@ -256,5 +267,9 @@
                     is = zipFile.getInputStream(entry);
                     switch (type) {
-                        case PNG:
+                        case SVG:
+                            URI uri = getSvgUniverse().loadSVG(is, full_name);
+                            img = createImageFromSvgUri(uri);
+                            break;
+                        case OTHER:
                             while(size > 0)
                             {
@@ -265,8 +280,4 @@
                             img = Toolkit.getDefaultToolkit().createImage(buf);
                             break;
-                        case SVG:
-                            URI uri = getSvgUniverse().loadSVG(is, full_name);
-                            img = createImageFromSvgUri(uri);
-                            break;
                     }
                 } finally {
@@ -292,10 +303,10 @@
         Image img = null;
         switch (type) {
-            case PNG:
-                img = Toolkit.getDefaultToolkit().createImage(path);
-                break;
             case SVG:
                 URI uri = getSvgUniverse().loadSVG(path);
                 img = createImageFromSvgUri(uri);
+                break;
+            case OTHER:
+                img = Toolkit.getDefaultToolkit().createImage(path);
                 break;
         }
