def social_image(self): from pretix.multidomain.urlreverse import build_absolute_uri img = None logo_file = self.settings.get('logo_image', as_type=str, default='')[7:] og_file = self.settings.get('og_image', as_type=str, default='')[7:] if og_file: img = get_thumbnail(og_file, '1200').thumb.url elif logo_file: img = get_thumbnail(logo_file, '5000x120').thumb.url if img: return urljoin(build_absolute_uri(self, 'presale:event.index'), img)
def get_picture(event, picture): try: thumb = get_thumbnail(picture.name, '60x60^').thumb.url except: logger.exception(f'Failed to create thumbnail of {picture.name}') thumb = default_storage.url(picture.name) return urljoin(build_absolute_uri(event, 'presale:event.index'), thumb)
def thumb(source, arg): if isinstance(source, File): source = source.name try: return get_thumbnail(source, arg).thumb.url except: logger.exception(f'Failed to create thumbnail of {source}') return default_storage.url(source)
def thumb(source, arg): if isinstance(source, File): source = source.name try: return get_thumbnail(source, arg).thumb.url except: logger.exception('Failed to create thumbnail') return default_storage.url(source)
def get_picture(event, picture): return urljoin(build_absolute_uri(event, 'presale:event.index'), get_thumbnail(picture.name, '60x60^').thumb.url)
def get_picture(picture): return get_thumbnail(picture.name, '60x60^').thumb.url