Exemple #1
0
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
Exemple #2
0
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
Exemple #3
0
def unanimate(im):
    if len(im) == 1:
        return im
    ret = Image()
    ret.append(im[0])
    return ret
Exemple #4
0
def test_appending_to_an_empty_image():
    img = Image()
    img.append(builtins.rose[0])

    assert img.size == builtins.rose.size