예제 #1
0
파일: images.py 프로젝트: hyena/libweasyl
def unanimate(im):
    """
    Get the non-animated version of a sanpera ``Image``.

    Paramters:
        im: A sanpera ``Image``.

    Returns:
        *im*, if it wasn't animated, or a new ``Image`` with just the first
        frame of *im* if it was.
    """
    if len(im) == 1:
        return im
    ret = Image()
    ret.append(im[0])
    return ret
예제 #2
0
파일: images.py 프로젝트: Weasyl/weasyl
def unanimate(im):
    """
    Get the non-animated version of a sanpera ``Image``.

    Paramters:
        im: A sanpera ``Image``.

    Returns:
        *im*, if it wasn't animated, or a new ``Image`` with just the first
        frame of *im* if it was.
    """
    if len(im) == 1:
        return im
    ret = Image()
    ret.append(im[0])
    return ret
예제 #3
0
파일: image.py 프로젝트: weykent/weasyl
def unanimate(im):
    if len(im) == 1:
        return im
    ret = Image()
    ret.append(im[0])
    return ret
예제 #4
0
def test_appending_to_an_empty_image():
    img = Image()
    img.append(builtins.rose[0])

    assert img.size == builtins.rose.size