Warning: session_start(): Session cannot be started after headers have already been sent in /home/tvrreohg/public_html/manga.php on line 13
3 iaÏã@süddlZddlZddlZddlZddlZddlmZddlmZgZ d%dd„Z d&dd„Z Gd d „d ƒZ Gd d „d e ƒZ ejd krˆe e ƒGdd„de ƒZejdkrªe eƒGdd„de ƒZGdd„deƒZGdd„deƒZGdd„deƒZGdd„deƒZejd'k�rVejdƒ�re eƒejdƒ�r.e eƒejdƒ�rBe eƒejdƒ�rVe eƒGdd „d e ƒZydd!lmZWnek �rŒYn Xe eƒed"k�røeejƒd#k�rÀed$ƒejƒej ejdƒ�"Z!ee e!fejd#d…žŽƒWdQRXdS)(éN)Úquote)ÚImageéc CsNyt|tƒr|ƒ}Wntk r(YnX|dkr>tj|ƒn tjd|ƒdS)a The :py:func:`register` function is used to register additional viewers. :param viewer: The viewer to be registered. :param order: Zero or a negative integer to prepend this viewer to the list, a positive integer to append it. rN)Ú issubclassÚViewerÚ TypeErrorÚ_viewersÚappendÚinsert)ÚviewerÚorder©r ú./tmp/tmp5hum_rxs/lib64/python/PIL/ImageShow.pyÚregisters    rcKs,x&tD]}|j|fd|i|—ŽrdSqWdS)a  Display a given image. :param image: An image object. :param title: Optional title. Not all viewers can display the title. :param \**options: Additional viewer options. :returns: ``True`` if a suitable viewer was found, ``False`` otherwise. Útitlerr)rÚshow)ÚimagerÚoptionsr r r rr.s rc@sHeZdZdZdd„ZdZiZdd„Zdd„Zd d „Z d d „Z d d„Z dS)rzBase class for viewers.cKsL|jdkp|jdko|jdks>tj|jƒ}|j|kr>|j|ƒ}|j|f|ŽS)zƒ The main function for displaying an image. Converts the given image to the target format and displays it. Ú1ÚRGBAÚPNGúI;16ÚLA)rr)rr)ÚmodeÚformatrZ getmodebaseÚconvertÚ show_image)ÚselfrrÚbaser r rrBs     z Viewer.showNcCs|jS)z3Return format name, or ``None`` to save as PGM/PPM.)r)rrr r rÚ get_formatYszViewer.get_formatcKst‚dS)zj Returns the command used to display the file. Not implemented in the base class. N)ÚNotImplementedError)rÚfilerr r rÚ get_command]szViewer.get_commandcCs|jfd|j|ƒi|j—ŽS)z+Save to temporary file and return filename.r)Ú_dumprr)rrr r rÚ save_imagedszViewer.save_imagecKs|j|j|ƒf|ŽS)zDisplay the given image.)Ú show_filer$)rrrr r rrhszViewer.show_imagecKstj|j|f|ŽƒdS)zDisplay the given file.r)ÚosÚsystemr")rr!rr r rr%lszViewer.show_file) Ú__name__Ú __module__Ú __qualname__Ú__doc__rrrrr"r$rr%r r r rr=src@s$eZdZdZdZddiZdd„ZdS)Ú WindowsViewerzNThe default viewer on Windows is the default system application for PNG files.rÚcompress_levelrcKsd|›d|›d�S)Nzstart "Pillow" /WAIT "z)" && ping -n 2 127.0.0.1 >NUL && del /f "ú"r )rr!rr r rr"{szWindowsViewer.get_commandN)r(r)r*r+rrr"r r r rr,usr,Úwin32c@s,eZdZdZdZddiZdd„Zdd„Zd S) Ú MacViewerz2The default viewer on macOS using ``Preview.app``.rr-rcKs(d}d|›dt|ƒ›dt|ƒ›d�}|S)Nzopen -a Preview.appú(ú z; sleep 20; rm -f z)&)r)rr!rÚcommandr r rr"�s zMacViewer.get_commandcKsbtjƒ\}}tj|dƒ�}|j|ƒWdQRXt|ƒ�}tjdgd|d�WdQRXtj|ƒdS)zDisplay given fileÚwNz7im=$(cat); open -a Preview.app $im; sleep 20; rm -f $imT)ÚshellÚstdinr) ÚtempfileÚmkstempr&ÚfdopenÚwriteÚopenÚ subprocessÚPopenÚremove)rr!rÚfdÚpathÚfr r rr%”s   zMacViewer.show_fileN)r(r)r*r+rrr"r%r r r rr0‡s r0Údarwinc@s(eZdZdZddiZdd„Zdd„ZdS) Ú UnixViewerrr-rcKs2|j|f|Žd}d|›dt|ƒ›dt|ƒ›d�S)Nrr1r2z; rm -f z)&)Úget_command_exr)rr!rr3r r rr"«szUnixViewer.get_commandcKs|tjƒ\}}tj|dƒ�}|j|ƒWdQRXt|ƒ�2}|j|f|Žd}tjd|dgd|d�WdQRXtj |ƒdS) zDisplay given filer4Nrz im=$(cat);z $im; rm -f $imT)r5r6r) r7r8r&r9r:r;rDr<r=r>)rr!rr?r@rAr3r r rr%¯s    zUnixViewer.show_fileN)r(r)r*rrr"r%r r r rrC§srCc@seZdZdZdd„ZdS)Ú DisplayViewerz$The ImageMagick ``display`` command.cKsd}}||fS)NÚdisplayr )rr!rr3Ú executabler r rrDÀszDisplayViewer.get_command_exN)r(r)r*r+rDr r r rrE½srEc@seZdZdZdd„ZdS)ÚGmDisplayViewerz*The GraphicsMagick ``gm display`` command.cKsd}d}||fS)NÚgmz gm displayr )rr!rrGr3r r rrDÈszGmDisplayViewer.get_command_exN)r(r)r*r+rDr r r rrHÅsrHc@seZdZdZdd„ZdS)Ú EogViewerz'The GNOME Image Viewer ``eog`` command.cKsd}d}||fS)NÚeogzeog -nr )rr!rrGr3r r rrDÑszEogViewer.get_command_exN)r(r)r*r+rDr r r rrJÎsrJc@seZdZdZddd„ZdS)ÚXVViewerzX The X Viewer ``xv`` command. This viewer supports the ``title`` parameter. NcKs&d}}|r|dt|ƒ›�7}||fS)NÚxvz -name )r)rr!rrr3rGr r rrDÝszXVViewer.get_command_ex)N)r(r)r*r+rDr r r rrL×srLrFrIrKrMc@seZdZdZdd„ZdS)Ú IPythonViewerz!The viewer for IPython frontends.cKs t|ƒdS)Nr)Úipython_display)rrrr r rrôszIPythonViewer.show_imageN)r(r)r*r+rr r r rrNñsrN)rFÚ__main__éz.Syntax: python3 ImageShow.py imagefile [title])r)N)r/rB)"r&Úshutilr<Úsysr7ÚshlexrÚPILrrrrrr,Úplatformr0rCrErHrJrLÚwhichrNZIPython.displayrFrOÚ ImportErrorr(ÚlenÚargvÚprintÚexitr;Zimr r r rÚsT    8