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/gimp_xcf.pyo
�
��Yc@sdZddlZddlZddlmZmZddlZddlZddlZde	fd��YZ
de
fd��YZde
fd	��YZd
e
fd��YZ
de
fd
��YZdejfd��YZedkre�Zej�ndS(s9
Copyright (C) 2006 Aaron Spike, aaron@ekips.org
Copyright (C) 2010-2012 Nicolas Dufour, nicoduf@yahoo.fr
(Windows support and various fixes)

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����N(tPopentPIPEtGimpXCFErrorcBseZRS((t__name__t
__module__(((s*/usr/share/inkscape/extensions/gimp_xcf.pyRstGimpXCFExpectedIOErrorcBseZRS((RR(((s*/usr/share/inkscape/extensions/gimp_xcf.pyR!stGimpXCFInkscapeNotInstalledcBseZd�ZRS(cCstjtd��dS(Ns9Inkscape must be installed and set in your path variable.(tinkexterrormsgt_(tself((s*/usr/share/inkscape/extensions/gimp_xcf.pyt__init__$s(RRR(((s*/usr/share/inkscape/extensions/gimp_xcf.pyR#stGimpXCFGimpNotInstalledcBseZd�ZRS(cCstjtd��dS(Ns5Gimp must be installed and set in your path variable.(RRR	(R
((s*/usr/share/inkscape/extensions/gimp_xcf.pyR(s(RRR(((s*/usr/share/inkscape/extensions/gimp_xcf.pyR'stGimpXCFScriptFuErrorcBseZd�ZRS(cCstjtd��dS(Ns0An error occurred while processing the XCF file.(RRR	(R
((s*/usr/share/inkscape/extensions/gimp_xcf.pyR,s(RRR(((s*/usr/share/inkscape/extensions/gimp_xcf.pyR
+stMyEffectcBs,eZd�Zd�Zd�Zd�ZRS(c
Cs�tjj|�|jjddddddd�|jjdd	dddd
dddtd
d�|jjdddddd
dddtd
d�|jjdddddd
dddtd
d�|jjddddddddddd
d�dS(Ns--tabtactiontstorettypetstringtdestttabs-ds--guidestinkboolt
saveGuidestdefaultthelpsSave the Guides with the .XCFs-rs--gridtsaveGridsSave the Grid with the .XCFs-bs--backgroundtlayerBackgrounds"Add background color to each layers-is--dpit
resolutiont96sFile resolution(RtEffectRtOptionParsert
add_optiontFalse(R
((s*/usr/share/inkscape/extensions/gimp_xcf.pyR1s(cCsdS(N((R
((s*/usr/share/inkscape/extensions/gimp_xcf.pytoutputGscCstj|j�dS(N(tshutiltrmtreettmp_dir(R
((s*/usr/share/inkscape/extensions/gimp_xcf.pyt	clear_tmpJsc.CsJ|jd}|jj�}|jtjdd��}|dkrS|jd}nt|j|j	d�j
d�d��}t|j|j	d�j
d�d��}tj�|_
g}g}|jjr�d}x|jj|d	tj�D]�}	|	jd
�}
|
dkrwt|	jd�j
d
�dj
d�d�}|dkr�||kr�|jt||��q�q�|
dkr�t|	jd�j
d
�dj
d�d�}|dkr�||kr�|jt|��q�q�q�Wndj|�}dj|�}
d}d}d}|jjr"|jj|d	tj�r"|j	|�}|dkr"|jd�}|dkr�d}n|jd�}|dkr�d}n|jd�}|dkr�d}n|jd�}|dkr�d}nd|d |d f}d|d |d f}q"nd}d}d|jj}|jjrW|d7}n
|d 7}g}g}d|_d!}x�|jj|d	tj�D]�}t|�dkr�d|_|jd"�}|jd#tjd$d%�r|jd#tjd$d%�}n|}tjj|j
d&|�}d'||||||f} t| d(td)td*td+t�}!|!j�}"|!j }#|!j!}$|!j"}%|#j#�|#j$�|$j$�|%j$�|"dkr�|j%�t&�ntj'd,kr�|j(d-d.�}n|j|�|j|�q�q�W|jdkrK|j%�tj)t*d/��n�d0d1j|�}&d0d1j|�}'tjj|j
d2|�}(tj'd,kr�|(j(d-d.�}(nd3|jj|jj|&|'||
|||(|(f
})tjj|j
d4�}*d5|*} t| d(td)td*td+t�}!|!j"}#|!j }+|!j!}$|#j+|)j,d6��|!j�}"|!j-dkr�|j%�t.�n|#j$�|$j$�|+j$�yt/|(d7�},Wn|j%�t0�nXtj'd,kry#ddl1}-|-j2dtj3�WqqXnzt4j j+|,j#��Wd|,j$�|j%�XdS(8Ni����tdocnameusodipodis/svg:svg/@heightt.is/svg:svg/@widths!sodipodi:namedview/sodipodi:guidet
namespacestorientations0,1tpositiont,is1,0t tsQsodipodi:namedview/inkscape:grid[@type='xygrid' and (not(@units) or @units='px')]tspacingxs1  tspacingytoriginxs0  toriginys'(gimp-image-grid-set-spacing img %s %s)i����s&(gimp-image-grid-set-offset img %s %s)s--export-area-pages--export-background-opacity=s
--export-dpi=t1t0s%/svg:svg/*[name()='g' or @style][@id]tidt{tinkscapes}labels%s.pngs'inkscape -i "%s" -j %s %s -e "%s" %s %stshelltstdintstdouttstderrtnts\t/s5This extension requires at least one non empty layer.s"%s"s" "s%s.xcfs
(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 %s %s)
  (gimp-image-undo-disable img)
  (for-each
    (lambda (names)
      (png-to-layer img (car names) (cdr names))
    )
    (map cons '(%s) '(%s))
  )

  (gimp-image-resize-to-layers img)

  (for-each
    (lambda (hGuide)
      (gimp-image-add-hguide img hGuide)
    )
    '(%s)
  )

  (for-each
    (lambda (vGuide)
      (gimp-image-add-vguide img vGuide)
    )
    '(%s)
  )

  %s
  %s

  (gimp-image-undo-enable img)
  (gimp-file-save RUN-NONINTERACTIVE img (car (gimp-image-get-active-layer img)) "%s" "%s"))
(gimp-quit 0)
            sjunk_from_gimp.txtsAgimp -i --batch-interpreter plug-in-script-fu-eval -b - > %s 2>&1sutf-8trb(5targstdocumenttgetroottgetRtaddNStNonetinttunittouutxpathSingletsplitttempfiletmkdtempR$toptionsRtxpathtNSStappendtstrtjoinRRRtvalidtlentostpathRtTrueRtwaitR9R:R8treadtcloseR%RtnametreplaceRR	twritetencodet
returncodeRtopenR
tmsvcrttsetmodetO_BINARYtsys(.R
tsvg_filet	ttmp_origR&t
pageHeightt	pageWidththGuidestvGuidest
guideXpatht	guideNodetoritposthGListtvGListtgridSpacingFunctgridOriginFunct	gridXpathtgridNodetspacingXtspacingYtoriginXtoriginYtareatopacityRtpngstnamesRStnodeR4RXtfilenametcommandtptreturn_codetfterrR8tfilelisttnamelisttxcft	script_futjunktouttxR^((s*/usr/share/inkscape/extensions/gimp_xcf.pyteffectMs�
++"// '				

	"	!$			




	

24
$			
	





(RRRR!R%R�(((s*/usr/share/inkscape/extensions/gimp_xcf.pyR0s			t__main__(t__doc__RRR"t
subprocessRRRaRHRt	ExceptionRRRRR
RRRtetaffect(((s*/usr/share/inkscape/extensions/gimp_xcf.pyt<module>s�