Exemplo n.º 1
0
def upload(userid, filedata):
    """
    Creates a preview-size copy of an uploaded image for a new banner
    selection file.
    """
    if not filedata:
        orm.UserMediaLink.clear_link(userid, 'banner')
        return

    media_item = media.make_resized_media_item(filedata, (1650, 250))
    orm.UserMediaLink.make_or_replace_link(userid, 'banner', media_item)
Exemplo n.º 2
0
def upload(userid, filedata):
    """
    Creates a preview-size copy of an uploaded image for a new banner
    selection file.
    """
    if not filedata:
        orm.UserMediaLink.clear_link(userid, 'banner')
        return

    media_item = media.make_resized_media_item(filedata, (1650, 250))
    orm.UserMediaLink.make_or_replace_link(userid, 'banner', media_item)
Exemplo n.º 3
0
def upload(userid, filedata):
    """
    Creates a preview-size copy of an uploaded image file for a new avatar
    selection file.
    """
    if filedata:
        media_item = media.make_resized_media_item(filedata, (600, 500), 'FileType')
        orm.UserMediaLink.make_or_replace_link(userid, 'avatar-source', media_item)
    else:
        orm.UserMediaLink.clear_link(userid, 'avatar')

    return bool(filedata)
Exemplo n.º 4
0
def upload(userid, filedata):
    """
    Creates a preview-size copy of an uploaded image file for a new avatar
    selection file.
    """
    if filedata:
        media_item = media.make_resized_media_item(filedata, (600, 500),
                                                   'FileType')
        orm.UserMediaLink.make_or_replace_link(userid, 'avatar-source',
                                               media_item)
    else:
        orm.UserMediaLink.clear_link(userid, 'avatar')

    return bool(filedata)