summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f3e28e1)
raw | patch | inline | side by side (parent: f3e28e1)
author | JazzyNico <nicoduf@yahoo.fr> | |
Thu, 15 Apr 2010 19:56:04 +0000 (21:56 +0200) | ||
committer | JazzyNico <nicoduf@yahoo.fr> | |
Thu, 15 Apr 2010 19:56:04 +0000 (21:56 +0200) |
share/extensions/extractimage.inx | patch | blob | history | |
share/extensions/extractimage.py | patch | blob | history |
index 364898c5145e577a4df37db6ea534972938e3d15..984dc9aef05d98e8e88a2148e5e013e7f2e675d1 100644 (file)
<id>org.ekips.filter.extractimage</id>
<dependency type="executable" location="extensions">extractimage.py</dependency>
<dependency type="executable" location="extensions">inkex.py</dependency>
- <param name="filepath" type="string" _gui-text="Path to save image">none</param>
- <_param name="desc" type="description">Note: The file extension is appended automatically.</_param>
+ <param name="filepath" type="string" _gui-text="Path to save image:">none</param>
+ <_param name="desc" type="description" xml:space="preserve">* Don't type the file extension, it is appended automatically.
+* A relative path (or a filename without path) is relative to the user's home directory.</_param>
<effect needs-live-preview="false">
<object-type>all</object-type>
<effects-menu>
index 8b47de958598ece6f223b2592c0e64a2e7b2f774..4093b94a7e97727c9ef0d7c70cc71ccf7712ba72 100644 (file)
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)