Ńň
ľSJc        	   @   sŃ   d    Z  d   Z e d j oŽ d d k Z d d k Z e e i  d j  o! d e i d GHe i d  n x\ e i d D]I Z e i e  Z	 e	 d j o d	 e e	 d e	 d f GHq| d
 e GHq| Wn d S(   c         C   s=   d  } t |  d  } | o | i d  } | i   n | S(   Nt   rbi    (   t   Nonet   opent   readt   close(   t   filenamet   ht   f(    (    sU   /mnt/luc/web/www.saillard.org/www/programs_and_patches/photon/photon.hg/Photon/PNG.pyt   read_headers   s    c         C   sĘ   t  |   } | d  j o d  S| d  d j o t | d  d >t | d  d >Bt | d  d >Bt | d  B} t | d  d >t | d	  d >Bt | d
  d >Bt | d  B} | | f Sd  S(   Ni   s   PNG

i   i   i   i   i   i   i   i   i   (   R   R   t   ord(   R   R   t   w(    (    sU   /mnt/luc/web/www.saillard.org/www/programs_and_patches/photon/photon.hg/Photon/PNG.pyt   identify   s    FFt   __main__i˙˙˙˙Ni   s   Usage: %s files...
i    i   s   %s (size = %d,%d)s   %s is not a PNG file(   R   R   t   __name__t   syst   PNGt   lent   argvt   exitR   t   infoR   (    (    (    sU   /mnt/luc/web/www.saillard.org/www/programs_and_patches/photon/photon.hg/Photon/PNG.pyt   <module>   s   			 
