ó
Ñ7ec           @   s…   d  d l  m Z d  d l m Z d  d l m Z d „  Z d e f d „  ƒ  YZ d e e f d „  ƒ  YZ d	 e j	 f d
 „  ƒ  YZ
 d S(   iÿÿÿÿ(   t   models(   t	   FieldFile(   t   Filec         C   s,   d d l  m } | |  ƒ } | j | j f S(   Niÿÿÿÿ(   t   VideoStream(   t   ffvideoR   t   frame_widtht   frame_height(   t   pathR   t   vs(    (    s;   /usr/local/lib/python2.7/dist-packages/image/video_field.pyt   get_video_dimensions   s    t	   VideoFilec           B   sA   e  Z d  Z d „  Z e e ƒ Z d „  Z e e ƒ Z d „  Z RS(   s€   
    A mixin for use alongside django.core.files.base.File, which provides
    additional features for dealing with images.
    c         C   s   |  j  ƒ  d S(   Ni    (   t   _get_video_dimensions(   t   self(    (    s;   /usr/local/lib/python2.7/dist-packages/image/video_field.pyt
   _get_width   s    c         C   s   |  j  ƒ  d S(   Ni   (   R   (   R   (    (    s;   /usr/local/lib/python2.7/dist-packages/image/video_field.pyt   _get_height   s    c         C   s>   t  |  d ƒ s7 |  j } |  j ƒ  t |  j ƒ |  _ n  |  j S(   Nt   _dimensions_cache(   t   hasattrt   closedt   openR	   R   R   (   R   t   close(    (    s;   /usr/local/lib/python2.7/dist-packages/image/video_field.pyR      s
    	
(	   t   __name__t
   __module__t   __doc__R   t   propertyt   widthR   t   heightR   (    (    (    s;   /usr/local/lib/python2.7/dist-packages/image/video_field.pyR
      s   		t   VideoFieldFilec           B   s   e  Z RS(    (   R   R   (    (    (    s;   /usr/local/lib/python2.7/dist-packages/image/video_field.pyR   '   s   t
   VideoFieldc           B   s   e  Z e Z RS(    (   R   R   R   t
   attr_class(    (    (    s;   /usr/local/lib/python2.7/dist-packages/image/video_field.pyR   +   s   N(   t	   django.dbR    t   django.db.models.fields.filesR   t   django.core.filesR   R	   R
   R   t	   FileFieldR   (    (    (    s;   /usr/local/lib/python2.7/dist-packages/image/video_field.pyt   <module>   s   	