HEX
Server: Apache
System: Linux srv1.prosuiteplus.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: prosuiteplus (1001)
PHP: 8.3.20
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/PIL/__pycache__/ImageShow.cpython-38.pyc
U

tCf��@stddlZddlZddlZddlZddlmZddlmZgZddd�Z	d dd�Z
Gd	d
�d
�Zejdkr�Gdd
�d
e�Z
e	e
�n�ejdkr�Gdd�de�Ze	e�nxGdd�de�ZGdd�de�Ze�d�r�e	e�Gdd�de�Ze�d�r�e	e�Gdd�de�Ze�d��re	e�edk�rpeej�dk�rHed�e��ee
e�ejd�fejdd����dS)!�N��quote)�Image�cCsVzt|t�r|�}Wntk
r(YnX|dkr>t�|�n|dkrRt�d|�dS)Nr)�
issubclass�Viewer�	TypeError�_viewers�append�insert)�viewer�order�r�//usr/lib/python3/dist-packages/PIL/ImageShow.py�registers

rcKs*tD] }|j|fd|i|��rdSqdS)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rrrr%s	rc@sHeZdZdZdd�ZdZiZdd�Zdd�Zd	d
�Z	dd�Z
d
d�ZdS)rzBase class for viewers.cKsL|jdks>|jdkr|jdks>t�|j�}|j|kr>|�|�}|j|f|�S)N)�1ZRGBA�PNGZLA)�mode�formatrZgetmodebaseZconvert�
show_image)�selfrr�baserrrr9s���

zViewer.showNcCs|jS)z.Return format name, or None to save as PGM/PPM)r�rrrrr�
get_formatJszViewer.get_formatcKst�dS)N)�NotImplementedError�r�filerrrr�get_commandNszViewer.get_commandcCs|jfd|�|�i|j��S)z+Save to temporary file, and return filenamer)Z_dumprrrrrr�
save_imageQszViewer.save_imagecKs|j|�|�f|�S)zDisplay given image)�	show_filer")rrrrrrrUszViewer.show_imagecKst�|j|f|��dS)�Display given filer)�os�systemr!rrrrr#YszViewer.show_file)�__name__�
__module__�__qualname__�__doc__rrrrr!r"rr#rrrrr4srZwin32c@s eZdZdZddiZdd�ZdS)�
WindowsViewerr�compress_levelrcKsd||fS)NzDstart "Pillow" /WAIT "%s" && ping -n 2 127.0.0.1 >NUL && del /f "%s"rrrrrr!hs��zWindowsViewer.get_commandN�r'r(r)rrr!rrrrr+dsr+�darwinc@s(eZdZdZddiZdd�Zdd�ZdS)	�	MacViewerrr,rcKsd}d�|t|�t|��}|S)Nzopen -a Preview.appz({} {}; sleep 20; rm -f {})&)rr�rr r�commandrrrr!ws�zMacViewer.get_commandcKs*t�ddd|g�t�tjdd|g�dS)r$�openz-azPreview.appz-cz:import os, sys, time;time.sleep(20);os.remove(sys.argv[1])r)�
subprocess�call�Popen�sys�
executablerrrrr#�s��zMacViewer.show_fileN)r'r(r)rrr!r#rrrrr/ss	r/c@s eZdZdZddiZdd�ZdS)�
UnixViewerrr,rcKs(|j|f|�d}d�|t|�t|��S)Nrz({} {}; rm -f {})&)�get_command_exrrr0rrrr!�szUnixViewer.get_commandNr-rrrrr8�sr8c@seZdZdd�Zdd�ZdS)�
DisplayViewercKsd}}||fS)N�displayr�rr rr1r7rrrr9�szDisplayViewer.get_command_excKs6dg}d|kr|d|dg7}|�|�t�|�dS)Nr;r�-namer�r
r3r5�rr r�argsrrrr#�s

zDisplayViewer.show_fileN�r'r(r)r9r#rrrrr:�sr:r;c@seZdZdd�Zdd�ZdS)�	EogViewercKsd}}||fS)N�eogrr<rrrr9�szEogViewer.get_command_excKst�dd|g�dS)NrCz-nr)r3r5rrrrr#�szEogViewer.show_fileNrArrrrrB�srBrCc@seZdZddd�Zdd�ZdS)�XVViewerNcKs$d}}|r|dt|�7}||fS)N�xvz	 -name %sr)rr rrr1r7rrrr9�szXVViewer.get_command_excKs6dg}d|kr|d|dg7}|�|�t�|�dS)NrErr=rr>r?rrrr#�s

zXVViewer.show_file)NrArrrrrD�s
rDrE�__main__�z-Syntax: python ImageShow.py imagefile [title])r)N)r%Zshutilr3r6ZshlexrZPILrr	rrr�platformr+r/r8r:ZwhichrBrDr'�len�argv�print�exitr2rrrr�<module>s<

.