diff options
| author | Jos Hirth <github@kaioa.com> | 2007-01-01 18:29:16 +0000 |
|---|---|---|
| committer | amphi <amphi@users.sourceforge.net> | 2007-01-01 18:29:16 +0000 |
| commit | 6f56b40a3af15ae1331fdac9eeaeca1d7f7d4983 (patch) | |
| tree | 9ac010f24713246e7c4edd63112b9c12fc58bcab | |
| parent | Fixed conflicting accelerators (diff) | |
| download | inkscape-6f56b40a3af15ae1331fdac9eeaeca1d7f7d4983.tar.gz inkscape-6f56b40a3af15ae1331fdac9eeaeca1d7f7d4983.zip | |
changed image/jpg to image/jpeg. added image/bmp, image/gif and image/x-icon.
(bzr r2119)
| -rw-r--r-- | share/extensions/embedimage.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/share/extensions/embedimage.py b/share/extensions/embedimage.py index b01407198..c7b00514b 100644 --- a/share/extensions/embedimage.py +++ b/share/extensions/embedimage.py @@ -46,14 +46,21 @@ class MyEffect(inkex.Effect): if (file[:4]=='\x89PNG'): type='image/png' elif (file[:2]=='\xff\xd8'): - type='image/jpg' + type='image/jpeg' + elif (file[:2]=='BM'): + type='image/bmp' + elif (file[:6]=='GIF87a' or file[:6]=='GIF89a'): + type='image/gif' + #ico files lack any magic... therefore we check the filename instead + elif(absref.value.endswith('.ico')): + type='image/x-icon' #official IANA registered MIME is 'image/vnd.microsoft.icon' tho else: embed=False if (embed): xlink.value = 'data:%s;base64,%s' % (type, base64.encodestring(file)) node.removeAttributeNS(inkex.NSS[u'sodipodi'],'absref') else: - inkex.debug("%s is not of type image/png or image/jpg" % absref.value) + inkex.debug("%s is not of type image/png, image/jpeg, image/bmp, image/gif or image/x-icon" % absref.value) else: inkex.debug("Sorry we could not locate %s" % absref.value) e = MyEffect() |
