embedimage.py revision 5ab5e83b30bb98a525e6f50f731fc7e21d372d97
'''
Copyright (C) 2005,2007 Aaron Spike, aaron@ekips.org
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
'''
help="embed only selected images")
# if slectedonly is enabled and there is a selection only embed selected
# images. otherwise embed all images
else:
path = '//svg:image'
path=''
#path selection strategy:
# 1. href if absolute
# 2. sodipodi:docbase + href
# 3. realpath-ified href
# 4. absref, only if the above does not point to a file
if (href != None):
elif (docbase != None):
else:
if (absref != None):
inkex.debug('No xlink:href or sodipodi:absref attributes found, or they do not point to an existing file! Unable to embed image.')
#ico files lack any magic... therefore we check the filename instead
else:
if (embed):
if (absref != None):
else:
else:
if __name__ == '__main__':
e = Embedder()
e.affect()