summaryrefslogtreecommitdiffstats
path: root/share/extensions/extractimage.py
diff options
context:
space:
mode:
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)