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__/ImageGrab.cpython-38.pyc
U

g�
^h	�@sTddlZddlZddlZddlZddlmZejdkr>ed��ddd�Zd	d
�Z	dS)�N�)�Image)Zwin32�darwinz#ImageGrab is macOS and Windows onlyFc	Cs�tjdkr^t�d�\}}t�|�t�dd|g�t�	|�}|�
�t�|�|r�|�|�}nttj
�||�\}}}t�d||dd|dd	d	d
@d�}|r�|\}	}
|\}}}
}|�||	||
|
|	||
f�}|S)Nrz.pngZ
screencapturez-xZRGB�rawZBGRr�������)�sys�platform�tempfile�mkstemp�os�close�
subprocess�callr�open�load�unlinkZcrop�coreZ
grabscreenZ	frombytes)ZbboxZinclude_layered_windowsZall_screens�fh�filepath�im�offset�size�dataZx0Zy0�left�top�rightZbottom�r�//usr/lib/python3/dist-packages/PIL/ImageGrab.py�grabs0



�
"r c	Cs�tjdkr�t�d�\}}t�|�d|dddddg}d	g}|D]}|d
|g7}qBt�|�d}t�|�j	dkr�t
�|�}|��t�
|�|St
j��}t|t�r�dd
lm}ddl}|�|�|��S|SdS)Nrz.jpgz,set theFile to (open for access POSIX file "z" with write permission)�tryz4    write (the clipboard as JPEG picture) to theFilezend tryzclose access theFileZ	osascriptz-err)�BmpImagePlugin)r	r
rrr
rrr�stat�st_sizerrrrr�
grabclipboard�
isinstance�bytes�r"�ioZDibImageFile�BytesIO)	rrZcommandsZscriptZcommandrrr"r)rrrr%:s:

���	




r%)NFF)
r
rr	rr(rr
�ImportErrorr r%rrrr�<module>s