image_attributes.py revision 4eb71a1f1c384514a812753c122d337bade334dd
'''
image_attributes.py - adjust image attributes which don't have global
GUI options yet
Tool for Inkscape 0.91 to adjust rendering of drawings with linked
or embedded bitmap images created with older versions of Inkscape
or third-party applications.
Copyright (C) 2015, ~suv <suv-sf@users.sf.net>
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
'''
# local library
import inkex
import simplestyle
try:
except:
import gettext
# main options
help="")
help="")
help="Value for attribute 'preserveAspectRatio'")
help="optional 'meetOrSlice' value")
help="scope within which to edit 'preserveAspectRatio' attribute")
help="Value for attribute 'image-rendering'")
help="scope within which to edit 'image-rendering' attribute")
# tabs
dest="tab_main")
# core method
if key == 'preserveAspectRatio':
# set presentation attribute
if value != "unset":
else:
elif key == 'image-rendering':
if key not in node_style:
# set presentation attribute
if value != "unset":
else:
else:
# set style property
if value != "unset":
else:
del node_style[key]
else:
pass
path = 'descendant-or-self::svg:image'
# methods called via dispatcher
if selected:
if selected:
if selected:
# main
attr_val = []
attr_dict = {}
cmd_scope = None
cmd_scope = "in_document"
else: # help tab
pass
# dispatcher
if cmd_scope is not None:
try:
except AttributeError:
if __name__ == '__main__':
e = SetAttrImage()
e.affect()
# vim: expandtab shiftwidth=4 tabstop=8 softtabstop=4 fileencoding=utf-8 textwidth=99