dahlia/wand — pull request #66 by niwibe (2012-10-11 22:11:36+00:00)
Title: Sequence improved api.

This pull request is completely based on https://github.com/dahlia/wand/pull/39 but improved and more simple api.

The original implementation had a strange behavior ever since modified the current image and never knew that was the image that really were using.

This is a concept for see if it fits better with the main library.

Sample code:

Open a pdf

>>> from wand.image import Image
>>> from wand.sequence import Sequence
>>> i = Image(filename="../BBBBB.pdf")
>>> i.has_sequence()
True

Create sequence from image and access like a python list to sequence images.

>>> s = Sequence(i, clone_by_default=False)
>>> s[1].save(filename="/tmp/img.png")
>>> i.destroy()

Checks if current jpg image has sequence.

>>> i = Image(filename="tie01.jpg")
>>> i.has_sequence()
False

If we see that the result is as expected and convinces you, I will implement the corresponding tests.

Andrey