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/embedimage.pyc
�
��Yc@s�dZddlZddlZddlZddlZddlZddlZdejfd��YZe	dkr�e�Z
e
j�ndS(s�
Copyright (C) 2005,2007 Aaron Spike, aaron@ekips.org

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����NtEmbeddercBs5eZd�Zd�Zd�Zd�Zd�ZRS(c
CsEtjj|�|jjddddddddd	td
d�dS(Ns-ss--selectedonlytactiontstorettypetinkbooltdesttselectedonlytdefaultthelpsembed only selected images(tinkextEffectt__init__tOptionParsert
add_optiontFalse(tself((s,/usr/share/inkscape/extensions/embedimage.pyRs
cCs9|jjr%|j|j|j�n|j|j�dS(N(toptionsRt
embedSelectedtdocumenttselectedtembedAll(R((s,/usr/share/inkscape/extensions/embedimage.pyteffect%scCsm||_||_|jjrixH|j�D]7\}}|jtjdd�kr+|j|�q+q+WndS(Ntimagetsvg(	RRRtidst	iteritemsttagR	taddNSt
embedImage(RRRtidtnode((s,/usr/share/inkscape/extensions/embedimage.pyR-s		cCsL||_d}x6|jj�j|dtj�D]}|j|�q1WdS(Ns//svg:imaget
namespaces(RtgetroottxpathR	tNSSR(RRtpathR((s,/usr/share/inkscape/extensions/embedimage.pyR5s	(c
	Cs�|jtjdd��}|dks7|d dkr�|jtjdd��}tj|�}tj|j�}d}|dkr�tjj	|�}ntjj
|�s�|dkr�|}q�nyt|d�}Wntk
r�|}nXtjj
|�s?tj
td	��|r?tj
td
�t|��q?ntjj
|�r�t|d�j�}t}|d d
kr�d}	n�|d dkr�d}	n�|d dkr�d}	np|d dks�|d dkr�d}	nG|d dks|d dkr	d}	n|jd�r!d}	nt}|r�|jtjdd�d|	tj|�f�|dkr�|jtjdd�=q�q�tj
td�|�q�ndS( Nthreftxlinkisdata:tabsreftsodipoditsutf-8ssNo xlink:href or sodipodi:absref attributes found, or they do not point to an existing file! Unable to embed image.sSorry we could not locate %strbis�PNGs	image/pngis��s
image/jpegtBMs	image/bmpitGIF87atGIF89as	image/giftMM*sII*s
image/tiffs.icosimage/x-iconsdata:%s;base64,%susodipodisZ%s is not of type image/png, image/jpeg, image/bmp, image/gif, image/tiff, or image/x-icon(tgetR	RtNoneturlparseturllibturl2pathnameR#tostrealpathtisfiletunicodet	TypeErrorterrormsgt_tstrtopentreadtTruetendswithRtsettbase64tencodestringtattrib(
RRR%R&turlR$R#tfiletembedR((s,/usr/share/inkscape/extensions/embedimage.pyR;sP

#			 	 		/(t__name__t
__module__RRRRR(((s,/usr/share/inkscape/extensions/embedimage.pyRs
				t__main__(t__doc__R@R3tsysR1R0R	R
RRFtetaffect(((s,/usr/share/inkscape/extensions/embedimage.pyt<module>sS