Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting the image index before any transforming process. #4

Open
lvkerang opened this issue Aug 1, 2013 · 0 comments
Open

Setting the image index before any transforming process. #4

lvkerang opened this issue Aug 1, 2013 · 0 comments

Comments

@lvkerang
Copy link

lvkerang commented Aug 1, 2013

At the end of method MagickReadImage, MagickReadImageBlob and MagickReadImageFile, the wand->image was pointed to the last frame in the image list. For multi-frame image, the image index should be set to 0 (first frame) before any transforming process.

Invoke MagickSetImageIndex after reading image, e.g.

clib.MagickReadImageBlob(self.wand, ffi.cast('const void *', blob), size)
clib.MagickSetImageIndex(self.wand, 0)

or add new method:

-- Setting the image index:
function Image:setImageIndex(i)
    clib.MagickSetImageIndex(self.wand, i or 0)
end
...
image:setImageIndex(0)
image:size(120, 120)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant