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__/gimp_xcf.cpython-310.pyc
o

0�a��@svdZddlZddlmZddlZddlmZddlmZm	Z	ddl
mZGdd�deej
�Zed	kr9e���dSdS)
z>
Export to Gimp's XCF file format including Grids and Guides.
�N)�OrderedDict)�TempDirMixin)�
take_snapshot�call)�
inkex_gettextc@s@eZdZdZdZdd�Zdd�Zdd�Zed	d
��Z	dd�Z
d
S)�GimpXcfz�
    Provide a quick and dirty way of using gimp to output an xcf from Inkscape.

    Both Inkscape and Gimp must be installed for this extension to work.
    z	gimp-out-cCsb|jddd�|jddtjdd�|jdd	tjd
d�|jddtjd
d�|jddtddd�dS)Nz--tab�tab)�destz-dz--guideszSave the Guides in the XCF)�type�helpz-rz--gridzSave the Grid with the .XCF�-bz--backgroundzAdd background colorz-iz--dpi�X@zFile resolution)r
�defaultr)�add_argument�inkex�Boolean�float)�self�pars�r�*/usr/share/inkscape/extensions/gimp_xcf.py�
add_arguments*s
zGimpXcf.add_argumentscCs�g}g}|jj��D];}|jr)d|jjkr|jjkr(nq
|�t|jj��q
|j	rEd|jj
kr:|jjkrEnq
|�t|jj
��q
dd�|�fdd�|�ffS)z5Generate a list of horzontal and vertical only guidesr�h� �v)
�svg�	namedview�
get_guides�
is_horizontal�point�y�height�append�str�is_vertical�x�width�join)r�horz_guides�vert_guides�guiderrrr1s � �zGimpXcf.get_guidesc
cs��|jj|jjd}d}|j�|�rP|j�|�}dD]6\}}}d|i}dD]}t|�|||��}	|j�|	d�|}	t	t
t|	���||<q&djd	i|��VqdSdS)
z5Get the grid if asked for and return as gimpfu scriptr
zQsodipodi:namedview/inkscape:grid[@type='xygrid' and (not(@units) or @units='px')]))�spacing�r+)�originr�offset�target�xy�pxz*(gimp-image-grid-set-{target} img {x} {y})Nr)r�scale�options�dpi�xpath�
getElementr�get�uutounit�int�round�format)
rr2r5�node�attrrr/�fmt�dim�unitrrr�get_gridCs��zGimpXcf.get_gridcCs|j�d�pdS)z)Get the document name suitable for exportzsodipodi:docname�document)rr7)rrrr�docnameSszGimpXcf.docnamec
Cs~t�}d}|j�d�D].}t|�sqd}|�d�}|�d|�}t|j|j|t|j	j
�|ddtt|j	j��d�||<q|sEt
�td��dStj�|jd�|j��}d	j|j	j
d
�|���d
�t|��d�}|j	jr{|��D]
\}	}
|dj|	|
d
�7}qm|j	jr�|��D]
}|d|d7}q�|dj|d�7}tddddd|d�t|d��}|�|���Wd�dS1s�wYdS)NFz%/svg:svg/*[name()='g' or @style][@id]T�idzinkscape:label)�dirname�namer4�	export_id�export_id_only�export_area_page�export_background_opacityz5This extension requires at least one non empty layer.z{}.xcfa�
(tracing 1)
(define
  (png-to-layer img png_filename layer_name)
  (let*
    (
      (png (car (file-png-load RUN-NONINTERACTIVE png_filename png_filename)))
      (png_layer (car (gimp-image-get-active-layer png)))
      (xcf_layer (car (gimp-layer-new-from-drawable png_layer img)))
    )
    (gimp-image-add-layer img xcf_layer -1)
    (gimp-drawable-set-name xcf_layer layer_name)
  )
)
(let*
  (
    (img (car (gimp-image-new 200 200 RGB)))
  )
  (gimp-image-set-resolution img {dpi} {dpi})
  (gimp-image-undo-disable img)
  (for-each
    (lambda (names)
      (png-to-layer img (car names) (cdr names))
    )
    (map cons '("{files}") '("{names}"))
  )

  (gimp-image-resize-to-layers img)
z" ")r4�files�namesze
  (for-each
    (lambda ({d}Guide)
      (gimp-image-add-{d}guide img {d}Guide)
    )
    '({g})
  ))�d�g�
z�
  (gimp-image-undo-enable img)
  (gimp-file-save RUN-NONINTERACTIVE img (car (gimp-image-get-active-layer img)) "{xcf}" "{xcf}"))
(gimp-quit 0)
            )�xcf�gimpr�-zplug-in-script-fu-eval)�i�batch_interpreter�stdin�rb)rrr5�lenr7rrB�tempdirr9r3r4�bool�
backgroundr�errormsg�_�os�pathr'r;rC�values�list�guidesr�gridrAr�open�write�read)
r�stream�pngs�validr<�node_idrFrP�	script_fur?ra�fu_let�fhlrrr�saveXsV

��"
�	�"�zGimpXcf.saveN)�__name__�
__module__�__qualname__�__doc__�
dir_prefixrrrA�propertyrCrmrrrrr"s
r�__main__)rqr]�collectionsrr�
inkex.baser�
inkex.commandrr�inkex.localizationrr\�OutputExtensionrrn�runrrrr�<module>s�

Youez - 2016 - github.com/yon3zu
LinuXploit