HEX
Server: Apache
System: Linux opal14.opalstack.com 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64
User: curbgloabal_opal (1234)
PHP: 8.1.29
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //usr/share/inkscape/extensions/image_attributes.pyo
�
��Yc@s]dZddlZddlZdejfd��YZedkrYe�Zej�ndS(s�
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>

This program is free software; you can redistribute it and/or modify
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., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
i����NtSetAttrImagecBsYeZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
RS(	cCsxtjj|�|jjddddddddtd	d
�|jjddddddddtd	d
�|jjd
ddddddddd	d�|jjdddddddddd	d�|jjdddddddddd	d�|jjdddddddddd	d�|jjdddddddddd	d�|jjd dddddd!�dS("Ns
--fix_scalingtactiontstorettypetinkbooltdesttfix_scalingtdefaultthelpts--fix_renderingt
fix_renderings--aspect_ratiotstringtaspect_ratiotnones)Value for attribute 'preserveAspectRatio's
--aspect_cliptaspect_cliptunsetsoptional 'meetOrSlice' values--aspect_ratio_scopetaspect_ratio_scopet
selected_onlys:scope within which to edit 'preserveAspectRatio' attributes--image_renderingtimage_renderings%Value for attribute 'image-rendering's--image_rendering_scopetimage_rendering_scopes6scope within which to edit 'image-rendering' attributes
--tab_mainttab_main(tinkextEffectt__init__tOptionParsert
add_optiontTruetFalse(tself((s2/usr/share/inkscape/extensions/image_attributes.pyR!s@cCs'x |j�D]\}}|dkri|dkrJ|j|t|��q|j|�r|j|=qq
|dkr
tj|jd��}||kr�|dkr�|j|t|��q|j|�r|j|=qq|dkr�t|�||<n||=|jdtj|��q
q
WdS(NtpreserveAspectRatioRsimage-renderingtstyle(titemstsettstrtgettattribtsimplestylet
parseStyletformatStyle(Rtnodet	attributetkeytvaluet
node_style((s2/usr/share/inkscape/extensions/image_attributes.pytchange_attributeGs$cCs=d}x0|j|dtj�D]}|j||�qWdS(Nsdescendant-or-self::svg:imaget
namespaces(txpathRtNSSR,(RR'R(tpathtimg((s2/usr/share/inkscape/extensions/image_attributes.pytchange_all_imagescscCsX|rTxK|j�D]:\}}|jtjdd�kr|j||�qqWndS(Ntimagetsvg(t	iteritemsttagRtaddNSR,(RtselectedR(tnode_idR'((s2/usr/share/inkscape/extensions/image_attributes.pytchange_selected_onlyjscCs:|r6x-|j�D]\}}|j||�qWndS(N(R5R2(RR8R(R9R'((s2/usr/share/inkscape/extensions/image_attributes.pytchange_in_selectionpscCs|j|jj�|�dS(N(R2tdocumenttgetroot(RR8R(((s2/usr/share/inkscape/extensions/image_attributes.pytchange_in_documentuscCs@|r<x3|j�D]"\}}|j|j�|�qWndS(N(R5R,t	getparent(RR8R(R9R'((s2/usr/share/inkscape/extensions/image_attributes.pytchange_on_parent_groupxscCs|j|jj�|�dS(N(R,R<R=(RR8R(((s2/usr/share/inkscape/extensions/image_attributes.pytchange_on_root_only}scCsjg}i}d}|jjdkred}|jjr<dnd|d<|jjrXdnd|d<n�|jjdkr�|jjg}|jjdkr�|j|jj�nd	j|�|d<|jj	}n1|jjd
kr|jj
|d<|jj}n|dk	rfy,t|dj
|��}||j|�Wqftk
rbtjdj
|��qfXndS(
Ns"tab_basic"tin_documentR
RRt
optimizeSpeedsimage-renderings"tab_aspectRatio"t s"tab_image_rendering"s
change_{0}sScope "{0}" not supported(tNonetoptionsRRR
RRtappendtjoinRRRtgetattrtformatR8tAttributeErrorRterrormsg(Rtattr_valt	attr_dictt	cmd_scopet
change_cmd((s2/usr/share/inkscape/extensions/image_attributes.pyteffect�s,
(t__name__t
__module__RR,R2R:R;R>R@RARQ(((s2/usr/share/inkscape/extensions/image_attributes.pyR s	&							t__main__(t__doc__RR$RRRRtetaffect(((s2/usr/share/inkscape/extensions/image_attributes.pyt<module>s~