
    d                     v    d Z ddlZddlmZ ddlmZmZmZ ddlm	Z	 d	dZ
 ej         e
                       dS )
z(Imagecodecs package command line script.    N)show)imshowaskopenfilenameTimer   )imreadTc                    | t           j        } t          |           dk     r$t          d          }|st	          d           dS n-t          |           dk    r	| d         }nt	          d           dS t                      }	 |                    d	           t          |d
          \  }}t	          |           n7# t          $ r*}t	          d           d}t          |          }Y d}~nd}~ww xY w|rt	                       |"t	          d           |rt	          |           dS |r8t	          |j
                                         d|j         d|j                    t          ||d           t                       dS )z-Imagecodecs command line usage main function.N   zSelect an image file)titlezNo file selectedr   zUsage: imagecodecs filenamezReading imageT)return_codecfailedzCould not decode the file
z:  nearest)r   interpolationr   )sysargvlenr   printr   startr   
ValueErrorstr__name__uppershapedtyper   r   )r   verbosecodecfilenametimerimage	exceptionmessages           4lib/python3.11/site-packages/imagecodecs/__main__.pymainr%      s    x
4yy1} 	")?@@@ 	$%%%2	 
Ta 7+,,,rGGE!O$$$hT:::ue ! ! !hi..!
   +,,, 	'NNNr H%%''FF5;FFFFGGG
5	::::FFF1s   8B; ;
C/ C**C/)NTN)__doc__r   matplotlib.pyplotr   tifffiler   r   r   imagecodecsr   r%   exit     r$   <module>r-      s    / . 



 " " " " " " 3 3 3 3 3 3 3 3 3 3      & & & &R 	     r,   