Ñò
•µSJc           @   s  d  Z  d d k l Z l Z l Z l Z d d d „  ƒ  YZ 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 xn e	 i d D][ Z e i e ƒ Z e d j o0 d e e i e i d
 e i d e i f GHq® d e GHq® Wn d S(   s7   This small library load and identify some image format iÿÿÿÿ(   t   JPEGt   GIFt   PNGt   PxMt   Imagec           B   s   e  Z d Z d Z d Z RS(   i    N(   i    i    (   t   __name__t
   __module__t   Nonet   formatt   sizet   mode(    (    (    sW   /mnt/luc/web/www.saillard.org/www/programs_and_patches/photon/photon.hg/Photon/Image.pyR      s   c         C   sô   t  ƒ  } t i |  ƒ } | d  j o d | _ | | _ | St i |  ƒ } | d  j o  d | _ | | _ d | _ | St i |  ƒ } | d  j o d | _ | | _ | St	 i |  ƒ \ } } | d  j o | | _ | | _ | St
 d ƒ ‚ d  S(   NR    R   t   PR   s   Format not recognized(   R   R    t   identifyR   R   R	   R   R
   R   R   t   IOError(   t   filenamet   imR	   R   (    (    sW   /mnt/luc/web/www.saillard.org/www/programs_and_patches/photon/photon.hg/Photon/Image.pyt   open   s.    										t   __main__Ni   s   Usage: %s files...
i    i   s$   %s (format=%s  size <%dx%d> mode=%s)s   %s is not recognized(    (   t   __doc__t   PhotonR    R   R   R   R   R   R   t   syst   lent   argvt   exitR   R   R   R   R	   R
   (    (    (    sW   /mnt/luc/web/www.saillard.org/www/programs_and_patches/photon/photon.hg/Photon/Image.pyt   <module>   s   "	 0
