X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/96bfd05319f9e393843e84ca5274d85ff248bad4..a92b0cfd2bd0bef75b43c071df0b0e028f360d8e:/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!"