
    lh	                        d Z ddlmZ ddlZ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mZ ddlmZ dZdd
Zedk    r eej                  dk     r edej                   eej        d         Z	  ee          5 Z ee           ddd           dS # 1 swxY w Y   dS # e$ r  edeej                   Y dS w xY wdS )a  :mod:`wand.display` --- Displaying images
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The :func:`display()` functions shows you the image.  It is useful for
debugging.

If you are in Mac, the image will be opened by your default image application
(:program:`Preview.app` usually).

If you are in Windows, the image will be opened by :program:`imdisplay.exe`,
or your default image application (:program:`Windows Photo Viewer` usually)
if :program:`imdisplay.exe` is unavailable.

You can use it from CLI also.  Execute :mod:`wand.display` module through
:option:`python -m <-m>` option:

.. sourcecode:: console

   $ python -m wand.display wandtests/assets/mona-lisa.jpg

.. versionadded:: 0.1.9

    )print_functionN   )library)	BlobErrorDelegateError)Image)display:0c                    t          | t                    st          dt          |           z             t	          j                    }|dk    r)	 |                     d           dS # t          $ r Y nw xY w|dv rnd| j        	                                z   }|dv rd	}t          j        |
          }|                     |           t          j        |dk    rdnd|z              dS t          j        t          j        gt           j        _        t!          j        | j        t)          |                                                     dS )a  Displays the passed ``image``.

    :param image: an image to display
    :type image: :class:`~wand.image.Image`
    :param server_name: X11 server name to use.  it is ignored and not used
                        for Mac.  default is ``':0'``
    :type server_name: :class:`str`

    z/image must be a wand.image.Image instance, not Windowszwin:.filenameN)r   Darwin.)miffxcpng)suffixzstart zopen )
isinstancer   	TypeErrorreprplatformsystemsaver   formatlowertempfilemktemposctypesc_void_pc_char_pr   MagickDisplayImageargtypeswandstrencode)imageserver_namer   extpaths        O/var/www/html/research.buxo.ca/env/lib/python3.11/site-packages/wand/display.pyr	   r	   '   s_    eU## %IU$ % % 	%_F	JJJ((( F  	 	 	D	 &&&EL&&(((.  Cc***

D
!!!
	v22884GHHHHH/5/5/@"+"5:s;/?/?/F/F/H/HIIIIIs   A' '
A43A4__main__   z"usage: python -m wand.display FILE)filer   zcannot read the file)r
   )__doc__
__future__r   r    r   r   sysr   apir   
exceptionsr   r   r(   r   __all__r	   __name__lenargvprintstderr
SystemExitr+        r,   <module>r>      s   . & % % % % %  				  



        0 0 0 0 0 0 0 0      
J J J JD z
s38}}q2DDDD8A;D=UD!!! 	UGENNN	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 = = =$d<<<<<<<= s6   3B% ?BB% BB% B B% %C C