def tag(self, alt='', use_size=None, **attrs):
        if use_size is None:
            if getattr(self, '_dimensions_cache', None):
                use_size = True
            else:
                try:
                    self.storage.path(self.name)
                    use_size = True
                except NotImplementedError:
                    use_size = False
        attrs['alt'] = alt
        attrs['src'] = self.url
        if use_size:
            attrs.update(dict(width=self.width, height=self.height))
        attrs = ' '.join(['%s="%s"' % (key, escape(value))
                          for key, value in sorted(attrs.items())])
        return mark_safe('<img %s />' % attrs)
Return a standard XHTML ``<img ... />`` tag for this field.
dataset/ETHPy150Open SmileyChris/easy-thumbnails/easy_thumbnails/files.py/ThumbnailFile.tag