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