Index: /applications/editors/josm/plugins/wmsplugin/webkit-image.cpp
===================================================================
--- /applications/editors/josm/plugins/wmsplugin/webkit-image.cpp	(revision 12008)
+++ /applications/editors/josm/plugins/wmsplugin/webkit-image.cpp	(revision 12009)
@@ -1,7 +1,10 @@
 /* compile with
 moc webkit-image.cpp >webkit-image.h
-g++ webkit-image.cpp -o webkit-image -lQtCore -lQtWebKit -lQtGui
+g++ webkit-image.cpp -o webkit-image -lQtCore -lQtWebKit -lQtGui -s -O2
+or under Windows:
+g++ webkit-image.cpp -o webkit-image -lQtCore4 -lQtWebKit4 -lQtGui4 -s O2
+adding the correct directories with -L or -I:
+-I C:\Progra~1\Qt\include -L C:\Progra~1\Qt\lib
 */
-
 #include <QtGui/QApplication>
 #include <QtCore/QFile>
@@ -69,5 +72,10 @@
       BINARYSTDOUT
       if(f.open(stdout, QIODevice::WriteOnly|QIODevice::Unbuffered))
-        p.save(&f, "JPG");
+      {
+        if(!p.save(&f, "JPEG"))
+        {
+          p.save(&f, "PNG");
+        }
+      }
     }
     emit finish();
