
3Nc        
   @   s   d  d k  l Z d  d k Z d  d k Z d e f d     YZ d   Z d   Z d   Z d   Z	 d Z
 d Z e
 e Z d Z e Z e Z h e d 6Z x e D] Z e e e <q Wd S(   i(   t   ImageNt   FormatExceptionc           B   s   e  Z RS(    (   t   __name__t
   __module__(    (    (    s?   /afs/sipb.mit.edu/project/bazki/Checkout/lib/bazbase/formats.pyR      s   c         C   s   t  i |  i    } | i S(   N(   R    t   opent   asPatht   size(   t   imt   i(    (    s?   /afs/sipb.mit.edu/project/bazki/Checkout/lib/bazbase/formats.pyt   pil_dimensions   s    c         C   sb   y7 t  i |  i    } | i i d | i i d f SWn$ t i j
 o } t |   n Xd  S(   Ng      ?(	   t   rsvgt   HandleR   t   propst   widtht   heightt   glibt   GErrorR   (   R   t   handlet   e(    (    s?   /afs/sipb.mit.edu/project/bazki/Checkout/lib/bazbase/formats.pyt   rsvg_dimensions   s
    "c         C   s;   |  i    t j p t d |  i     t |  i    |   S(   sD   Returns a tuple (width, height) for the image in the given Intermed.s   Unknown format: (   t   getExtensiont   MEASURABLE_FORMATSt   AssertionError(   R   (    (    s?   /afs/sipb.mit.edu/project/bazki/Checkout/lib/bazbase/formats.pyt   get_dimensions   s    c         C   s,   |  t  j o |  S|  t j o d Sd Sd  S(   Ns   .svgs   .png(   R   t   VECTOR_FORMATS(   t   format(    (    s?   /afs/sipb.mit.edu/project/bazki/Checkout/lib/bazbase/formats.pyt   get_measurable_format   s
    s   .pngs   .jpgs   .gifs   .tiffs   .bmps   .ppms   .xbms   .xpms   .icos   .epss   .epdfs   .svg(   s   .pngs   .jpgs   .gifs   .tiffs   .bmps   .ppms   .xbm(   s   .xpms   .ico(   s   .epss   .epdf(   t   PILR    R
   R   t	   ExceptionR   R	   R   R   R   t   PIL_WRITABLE_FORMATSt   PIL_READ_ONLY_FORMATSt   PIL_RASTER_FORMATSt   PSTOEDIT_READABLE_FORMATSt   RASTER_FORMATSR   R   t   f(    (    (    s?   /afs/sipb.mit.edu/project/bazki/Checkout/lib/bazbase/formats.pyt   <module>   s"   				 
 