]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/tools/img2xpm.py
don't use EM_STREAMIN at all in Unicode mode, it's not needed
[wxWidgets.git] / wxPython / tools / img2xpm.py
index e77109596875e4e800786a8558478edde7fefc7f..692156d35d9727165f85de794808e8d57bbbb027 100644 (file)
@@ -8,7 +8,7 @@ Usage:
 
 Options:
 
 
 Options:
 
-    -o <dir>       The directory to place the .xmp file(s), defaults to
+    -o <dir>       The directory to place the .xpm file(s), defaults to
                    the current directory.
 
     -m <#rrggbb>   If the original image has a mask or transparency defined
                    the current directory.
 
     -m <#rrggbb>   If the original image has a mask or transparency defined
@@ -24,6 +24,7 @@ Options:
 
 import sys, os, glob, getopt, string
 from wxPython.wx import *
 
 import sys, os, glob, getopt, string
 from wxPython.wx import *
+
 wxInitAllImageHandlers()
 
 
 wxInitAllImageHandlers()
 
 
@@ -50,7 +51,11 @@ def convert(file, maskClr, outputDir, outputName):
         if img.SaveFile(newname, wxBITMAP_TYPE_XPM):
             return 1, file + " converted to " + newname
         else:
         if img.SaveFile(newname, wxBITMAP_TYPE_XPM):
             return 1, file + " converted to " + newname
         else:
-            return 0, file + " failed to save!"
+            img = wxImageFromBitmap(img)
+            if img.SaveFile(newname, wxBITMAP_TYPE_XPM):
+                return 1, "ok"
+            else:
+                return 0, file + " failed to save!"