Ë
    ™2Úit   ã            	       óâ  — d dl Z d dlZd dlZd dlZd dlmZ ddlmZ g Zd'd„Z	d(d„Z
 G d„ d«      Z G d	„ d
e«      Zej                  dk(  r e	e«        G d„ de«      Zej                  dk(  r e	e«        G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Zej                  dvr‚ ej*                  d«      r e	e«        ej*                  d«      r e	e«        ej*                  d«      r e	e«        ej*                  d«      r e	e«        ej*                  d «      r e	e«        G d!„ d"e«      Z	 d d#lmZ  e	e«       ed$k(  rs eej:                  «      d%k  r ed&«        ej>                  «         ej@                  ej:                  d   «      5 Z! e e
e!gej:                  d%d ¢­Ž «       ddd«       yy# e$ r Y Œ€w xY w# 1 sw Y   yxY w))é    N©Úquoteé   )ÚImagec                 ó´   — 	 t        | t        «      r | «       } |dkD  rt        j	                  | «       yt        j                  d| «       y# t        $ r Y Œ=w xY w)a$  
    The :py:func:`register` function is used to register additional viewers::

        from PIL import ImageShow
        ImageShow.register(MyViewer())  # MyViewer will be used as a last resort
        ImageShow.register(MySecondViewer(), 0)  # MySecondViewer will be prioritised
        ImageShow.register(ImageShow.XVViewer(), 0)  # XVViewer will be prioritised

    :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.
    r   N)Ú
issubclassÚViewerÚ	TypeErrorÚ_viewersÚappendÚinsert)ÚviewerÚorders     úD/var/www/html/acx/venv/lib/python3.12/site-packages/PIL/ImageShow.pyÚregisterr      sO   € ðÜ�fœfÔ%Ù“XˆFð ˆq‚yÜ�‰˜Õä�‰˜˜6Õ"øô ò Ùðús   ‚A Á	AÁAc                 óH   — t         D ]  } |j                  | fd|i|¤ŽsŒ y y)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.
    ÚtitleTF)r   Úshow)Úimager   Úoptionsr   s       r   r   r   2   s3   € ô ò ˆØˆ6�;‰;�uÑ5 EÐ5¨WÓ5Ùðð ó    c                   ó@   — e Zd ZdZd„ ZdZ	 i Z	 d„ Zd„ Zd„ Z	d„ Z
d„ Zy)	r	   zBase class for viewers.c                 óü   — |j                   dv s\| j                  dk(  r|j                   dv s?t        j                  |j                   «      }|j                   |k7  r|j	                  |«      } | j
                  |fi |¤ŽS )zƒ
        The main function for displaying an image.
        Converts the given image to the target format and displays it.
        )Ú1ÚRGBAÚPNG)zI;16ÚLA)ÚmodeÚformatr   ÚgetmodebaseÚconvertÚ
show_image)Úselfr   r   Úbases       r   r   zViewer.showF   sk   € ð �J‰J˜-Ñ'Ø—‘˜uÒ$¨¯©°~Ñ)Eä×$Ñ$ U§Z¡ZÓ0ˆDØ�z‰z˜TÒ!ØŸ™ dÓ+�àˆt�‰˜uÑ0¨Ñ0Ð0r   Nc                 ó   — | j                   S )z3Return format name, or ``None`` to save as PGM/PPM.)r   ©r#   r   s     r   Ú
get_formatzViewer.get_format]   s   € à�{‰{Ðr   c                 ó   — t         ‚)zj
        Returns the command used to display the file.
        Not implemented in the base class.
        )ÚNotImplementedError©r#   Úfiler   s      r   Úget_commandzViewer.get_commanda   s
   € ô
 "Ð!r   c                 ó\   —  |j                   dd| j                  |«      i| j                  ¤ŽS )z+Save to temporary file and return filename.r   © )Ú_dumpr'   r   r&   s     r   Ú
save_imagezViewer.save_imageh   s(   € àˆu�{‰{ÑI $§/¡/°%Ó"8ÐI¸D¿L¹LÑIÐIr   c                 óF   —  | j                   | j                  |«      fi |¤ŽS )zDisplay the given image.)Ú	show_filer0   ©r#   r   r   s      r   r"   zViewer.show_imagel   s!   € àˆt�~‰~˜dŸo™o¨eÓ4Ñ@¸Ñ@Ð@r   c                 óP   — t        j                   | j                  |fi |¤Ž«       y)ú%
        Display given file.
        r   )ÚosÚsystemr,   ©r#   Úpathr   s      r   r2   zViewer.show_filep   s&   € ô 	�	‰	Ð"�$×"Ñ" 4Ñ3¨7Ñ3Ô4Ør   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r'   r,   r0   r"   r2   r.   r   r   r	   r	   A   s7   „ Ù!ò1ð$ €FØ/Ø€GØ7òò"òJòAór   r	   c                   ó$   — e Zd ZdZdZdddœZd„ Zy)ÚWindowsViewerzNThe default viewer on Windows is the default system application for PNG files.r   r   T©Úcompress_levelÚsave_allc                 ó   — d|› d|› d�S )Nzstart "Pillow" /WAIT "z)" && ping -n 4 127.0.0.1 >NUL && del /f "ú"r.   r*   s      r   r,   zWindowsViewer.get_command�   s   € à$ T Fð +à˜˜qð"ð	
r   N)r:   r;   r<   r=   r   r   r,   r.   r   r   r?   r?   {   s   „ ÙXà€FØ!"°Ñ5€Gó
r   r?   Úwin32c                   ó*   — e Zd ZdZdZdddœZd„ Zd„ Zy)	Ú	MacViewerz2The default viewer on macOS using ``Preview.app``.r   r   Tr@   c                 óF   — d}d|› dt        |«      › dt        |«      › d�}|S )Nzopen -a Preview.appú(ú z; sleep 20; rm -f z)&r   ©r#   r+   r   Úcommands       r   r,   zMacViewer.get_command“   s1   € ð (ˆØ�g�Y˜a¤ d£˜}Ð,>¼uÀT»{¸mÈ2ÐNˆØˆr   c                 óº   — t        j                  ddd|g«       t        j                  xs t	        j
                  d«      }|rt        j                  |dd|g«       y)r5   Úopenz-azPreview.appÚpython3z-cz<import os, sys, time; time.sleep(20); os.remove(sys.argv[1])r   )Ú
subprocessÚcallÚsysÚ
executableÚshutilÚwhichÚPopen)r#   r9   r   rS   s       r   r2   zMacViewer.show_fileš   sW   € ô 	�‰˜  }°dÐ;Ô<Ü—^‘^Ò>¤v§|¡|°IÓ'>ˆ
ÙÜ×ÑàØØRØð	ôð r   N)r:   r;   r<   r=   r   r   r,   r2   r.   r   r   rG   rG   �   s   „ Ù<à€FØ!"°Ñ5€Gòór   rG   Údarwinc                   ó    — e Zd ZdZdddœZd„ Zy)Ú
UnixViewerr   r   Tr@   c                 óP   —  | j                   |fi |¤Žd   }d|› dt        |«      › �S )Nr   rI   rJ   )Úget_command_exr   rK   s       r   r,   zUnixViewer.get_command´   s5   € Ø%�$×%Ñ% dÑ6¨gÑ6°qÑ9ˆØ�7�)˜1œU 4›[˜MÐ*Ð*r   N)r:   r;   r<   r   r   r,   r.   r   r   rY   rY   °   s   „ Ø€FØ!"°Ñ5€Gó+r   rY   c                   ó   — e Zd ZdZd„ Zd„ Zy)Ú	XDGViewerz3
    The freedesktop.org ``xdg-open`` command.
    c                 ó   — dx}}||fS )Núxdg-openr.   )r#   r+   r   rL   rS   s        r   r[   zXDGViewer.get_command_ex¾   s   € Ø)Ð)ˆ�*Ø˜
Ð"Ð"r   c                 ó2   — t        j                  d|g«       y)r5   r_   r   ©rP   rV   r8   s      r   r2   zXDGViewer.show_fileÂ   s   € ô 	×Ñ˜* dÐ+Ô,Ør   N©r:   r;   r<   r=   r[   r2   r.   r   r   r]   r]   ¹   s   „ ñò#ór   r]   c                   ó   — e Zd ZdZdd„Zd„ Zy)ÚDisplayViewerz`
    The ImageMagick ``display`` command.
    This viewer supports the ``title`` parameter.
    Nc                 ó8   — dx}}|r|dt        |«      › �z  }||fS )NÚdisplayz -title r   ©r#   r+   r   r   rL   rS   s         r   r[   zDisplayViewer.get_command_exÐ   s/   € Ø(Ð(ˆ�*ÙØ˜¤%¨£, Ð0Ñ0ˆGØ˜
Ð"Ð"r   c                 óŠ   — dg}|j                  d«      }|r|d|gz  }|j                  |«       t        j                  |«       y)r5   rf   r   z-titler   ©Úgetr   rP   rV   ©r#   r9   r   Úargsr   s        r   r2   zDisplayViewer.show_fileÖ   sH   € ð ˆ{ˆØ—‘˜GÓ$ˆÙØ�X˜uÐ%Ñ%ˆDØ�‰�DÔä×Ñ˜ÔØr   ©Nrb   r.   r   r   rd   rd   Ê   s   „ ñó
#ór   rd   c                   ó   — e Zd ZdZd„ Zd„ Zy)ÚGmDisplayViewerz*The GraphicsMagick ``gm display`` command.c                 ó   — d}d}||fS )NÚgmz
gm displayr.   ©r#   r+   r   rS   rL   s        r   r[   zGmDisplayViewer.get_command_exç   s   € Øˆ
ØˆØ˜
Ð"Ð"r   c                 ó4   — t        j                  dd|g«       y)r5   rq   rf   r   ra   r8   s      r   r2   zGmDisplayViewer.show_fileì   s   € ô 	×Ñ˜$ 	¨4Ð0Ô1Ør   Nrb   r.   r   r   ro   ro   ä   s   „ Ù4ò#ó
r   ro   c                   ó   — e Zd ZdZd„ Zd„ Zy)Ú	EogViewerz'The GNOME Image Viewer ``eog`` command.c                 ó   — d}d}||fS )NÚeogzeog -nr.   rr   s        r   r[   zEogViewer.get_command_ex÷   s   € Øˆ
ØˆØ˜
Ð"Ð"r   c                 ó4   — t        j                  dd|g«       y)r5   rw   z-nr   ra   r8   s      r   r2   zEogViewer.show_fileü   s   € ô 	×Ñ˜%  tÐ,Ô-Ør   Nrb   r.   r   r   ru   ru   ô   s   „ Ù1ò#ó
r   ru   c                   ó   — e Zd ZdZdd„Zd„ Zy)ÚXVViewerzX
    The X Viewer ``xv`` command.
    This viewer supports the ``title`` parameter.
    Nc                 ó8   — dx}}|r|dt        |«      › �z  }||fS )NÚxvz -name r   rg   s         r   r[   zXVViewer.get_command_ex
  s1   € ð  $Ð#ˆ�*ÙØ˜¤ u£ Ð/Ñ/ˆGØ˜
Ð"Ð"r   c                 óŠ   — dg}|j                  d«      }|r|d|gz  }|j                  |«       t        j                  |«       y)r5   r|   r   z-namer   ri   rk   s        r   r2   zXVViewer.show_file  sH   € ð ˆvˆØ—‘˜GÓ$ˆÙØ�W˜eÐ$Ñ$ˆDØ�‰�DÔä×Ñ˜ÔØr   rm   rb   r.   r   r   rz   rz     s   „ ñó
#ór   rz   )rE   rW   r_   rf   rq   rw   r|   c                   ó   — e Zd ZdZd„ Zy)ÚIPythonViewerz!The viewer for IPython frontends.c                 ó   — t        |«       y)Nr   )Úipython_displayr3   s      r   r"   zIPythonViewer.show_image0  s   € Ü˜ÔØr   N)r:   r;   r<   r=   r"   r.   r   r   r   r   -  s
   „ Ù+ór   r   )rf   Ú__main__é   z.Syntax: python3 ImageShow.py imagefile [title])r   rm   )"r6   rT   rP   rR   Úshlexr   Ú r   r   r   r   r	   r?   ÚplatformrG   rY   r]   rd   ro   ru   rz   rU   r   ÚIPython.displayrf   r�   ÚImportErrorr:   ÚlenÚargvÚprintÚexitrN   Úimr.   r   r   ú<module>rŽ      sï  ðó 
Û Û Û 
Ý å à€ó#ó2÷4ñ 4ôt
�Fô 
ð ‡<�<�7ÒÙˆ]Ôô�ô ð> ‡<�<�8ÒÙˆYÔô+�ô +ô�
ô ô"�Jô ô4�jô ô �
ô ô ˆzô ð8 ‡<�<Ð*Ñ*Ø€v‡|�|�JÔÙ�ÔØ€v‡|�|�IÔÙ�ÔØ€v‡|�|�DÔÙ�Ô!Ø€v‡|�|�EÔÙ�ÔØ€v‡|�|�DÔÙ�Ôô�Fô ðÝ:ñ ˆ]Ôð ˆzÒÙ
ˆ3�8‰8ƒ}�qÒÙÐ>Ô?Øˆ�‰Œ
à	ˆ�‰�C—H‘H˜Q‘KÓ	 ð ' BÙ‰d�2Ð%˜Ÿ™  ˜Ò%Ô&÷'ð 'ð øð ò 	Ùð	ú÷'ð 'ús   ÅG Æ3G%ÇG"Ç!G"Ç%G.