django_thumbs/db/models.py
def _url_for_size(self, size):
        """Return a URL pointing to the thumbnail image of the requested size.
        If `THUMBS_GENERATE_MISSING_THUMBNAILS` is True, the thumbnail will be created if it doesn't exist on disk.
            
        Arguments:
        size  -- A tuple with the desired width and height. Example: (100, 100)

        """
        if not self:
            return ''
        else:
            # generate missing thumbnail if needed
            fileBase, extension = self.name.rsplit('.', 1)
            thumb_file = self.THUMB_SUFFIX % (fileBase, size[0], size[1], extension)
            if THUMBS_GENERATE_MISSING_THUMBNAILS:
                if not self.storage.exists(thumb_file):
                    try:
                        self._generate_thumb(self.storage.open(self.name), size)
                    except:
                        if settings.DEBUG:
                            import sys
                            print("Exception generating thumbnail")
                            print(sys.exc_info())
            urlBase, extension = self.url.rsplit('.', 1)
            thumb_url = self.THUMB_SUFFIX % (urlBase, size[0], size[1], extension)
            return thumb_url
Return a URL pointing to the thumbnail image of the requested size.
        If `THUMBS_GENERATE_MISSING_THUMBNAILS` is True, the thumbnail will be created if it doesn't exist on disk.
            
        Arguments:
        size  -- A tuple with the desired width and height. Example: (100, 100)

        
Return a URL pointing to the thumbnail image of the requested size.
If `THUMBS_GENERATE_MISSING_THUMBNAILS` is True, the thumbnail will be created if it doesn't exist on disk.

size  -- A tuple with the desired width and height.
Return a URL pointing to the thumbnail image of the requested size . If ` THUMBS_GENERATE_MISSING_THUMBNAILS ` is True the thumbnail will be created if it doesn ' t exist on disk . size -- A tuple with the desired width and height .
def _url_for_size(self, size):
        if not self:
            return ''
        else:
            fileBase, extension = self.name.rsplit('.', 1)
            thumb_file = self.THUMB_SUFFIX % (fileBase, size[0], size[1], extension)
            if THUMBS_GENERATE_MISSING_THUMBNAILS:
                if not self.storage.exists(thumb_file):
                    try:
                        self._generate_thumb(self.storage.open(self.name), size)
                    except:
                        if settings.DEBUG:
                            import sys
                            print("Exception generating thumbnail")
                            print(sys.exc_info())
            urlBase, extension = self.url.rsplit('.', 1)
            thumb_url = self.THUMB_SUFFIX % (urlBase, size[0], size[1], extension)
            return thumb_url
def _url_for_size ( self , size ) : if not self : return '' else : fileBase , extension = self . name . rsplit ( '.' , 1 ) thumb_file = self . THUMB_SUFFIX % ( fileBase , size [ 0 ] , size [ 1 ] , extension ) if THUMBS_GENERATE_MISSING_THUMBNAILS : if not self . storage . exists ( thumb_file ) : try : self . _generate_thumb ( self . storage . open ( self . name ) , size ) except : if settings . DEBUG : import sys print ( "Exception generating thumbnail" ) print ( sys . exc_info ( ) ) urlBase , extension = self . url . rsplit ( '.' , 1 ) thumb_url = self . THUMB_SUFFIX % ( urlBase , size [ 0 ] , size [ 1 ] , extension ) return thumb_url
Return a URL pointing to the thumbnail image of the requested size.
Return a URL pointing to the thumbnail image of the requested size .
"""Return a URL pointing to the thumbnail image of the requested size.
        If `THUMBS_GENERATE_MISSING_THUMBNAILS` is True, the thumbnail will be created if it doesn't exist on disk.
            
        Arguments:
        size  -- A tuple with the desired width and height. Example: (100, 100)

        """ # generate missing thumbnail if needed
self
size