X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/96bfd05319f9e393843e84ca5274d85ff248bad4..761df41e86ceeed56d32c038a6c9f88554d4f47a:/wxPython/tools/img2xpm.py
diff --git a/wxPython/tools/img2xpm.py b/wxPython/tools/img2xpm.py
index e771095968..692156d35d 100644
--- a/wxPython/tools/img2xpm.py
+++ b/wxPython/tools/img2xpm.py
@@ -8,7 +8,7 @@ Usage:
Options:
- -o
The directory to place the .xmp file(s), defaults to
+ -o 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
@@ -24,6 +24,7 @@ Options:
import sys, os, glob, getopt, string
from wxPython.wx import *
+
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:
- 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!"