summaryrefslogtreecommitdiffstats
path: root/share/extensions/extractimage.py
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-05-15 18:08:17 +0000
committerTed Gould <ted@gould.cx>2010-05-15 18:08:17 +0000
commit2d8c2dfd832ce207aef3895e702bff4098ab7136 (patch)
tree642a37c6e3ca05d5e991ffe868f03c9cc58e51bc /share/extensions/extractimage.py
parentMerge from trunk (diff)
parentMinor tweaks to text toolbar. (diff)
downloadinkscape-2d8c2dfd832ce207aef3895e702bff4098ab7136.tar.gz
inkscape-2d8c2dfd832ce207aef3895e702bff4098ab7136.zip
Updating to trunk
(bzr r8254.1.54)
Diffstat (limited to 'share/extensions/extractimage.py')
-rw-r--r--share/extensions/extractimage.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/share/extensions/extractimage.py b/share/extensions/extractimage.py
index 8b47de958..4093b94a7 100644
--- a/share/extensions/extractimage.py
+++ b/share/extensions/extractimage.py
@@ -54,10 +54,16 @@ class MyEffect(inkex.Effect):
semicolon = xlink.find(';')
if semicolon>0:
for sub in mimesubext.keys():
- if sub in xlink[5:semicolon]:
+ if sub in xlink[5:semicolon].lower():
fileext=mimesubext[sub]
path=path+fileext;
- break
+ if (not os.path.isabs(path)):
+ if os.name == 'nt':
+ path = os.path.join(os.environ['USERPROFILE'],path)
+ else:
+ path = os.path.join(os.path.expanduser("~"),path)
+ inkex.errormsg(_('Image extracted to: %s') % path)
+ break
#save
data = base64.decodestring(xlink[comma:])
open(path,'wb').write(data)