ó <×ï[c@s§ddlmZddlZejd kr:edƒ‚nejdkrXejjZn6ejdkrŽddlZddl Z ddl Z ndd„Z d„Z dS( i(tImageiÿÿÿÿNtwin32tdarwins#ImageGrab is macOS and Windows onlycCsÌtjdkrptjdƒ\}}tj|ƒtjdd|gƒtj |ƒ}|j ƒtj |ƒn@t ƒ\}}tj d||dd|dd d d @d ƒ}|rÈ|j|ƒ}n|S( NRs.pngt screencaptures-xtRGBtrawtBGRiiiüÿÿÿiÿÿÿÿ(tsystplatformttempfiletmkstemptostcloset subprocesstcallRtopentloadtunlinktgrabbert frombytestcrop(tbboxtfhtfilepathtimtsizetdata((s-/tmp/pip-build-SKekGm/pillow/PIL/ImageGrab.pytgrab s   "c Cs(tjdkrÐtjdƒ\}}tj|ƒd|dddddg}d g}x|D]}|d |g7}q^Wtj|ƒd}tj |ƒj d kr¿t j |ƒ}|j ƒntj|ƒ|St jjƒ}t|tƒr d d lm}ddl}|j|j|ƒƒS|SdS(NRs.jpgs,set theFile to (open for access POSIX file "s" with write permission)ttrys0write (the clipboard as JPEG picture) to theFilesend trysclose access theFilet osascripts-eii(tBmpImagePluginiÿÿÿÿ(RRR R R R R RtNonetstattst_sizeRRRRtcoret grabclipboardt isinstancetbytestRtiot DibImageFiletBytesIO( RRtcommandstscripttcommandRRRR'((s-/tmp/pip-build-SKekGm/pillow/PIL/ImageGrab.pyR#4s0         (RR(R&RRRt ImportErrorR"t grabscreenRR R R RRR#(((s-/tmp/pip-build-SKekGm/pillow/PIL/ImageGrab.pyts