Replies: 4 comments
-
|
I believe you are correct in that I think I might be able to do this for I'll do some experiments today on this. If |
Beta Was this translation helpful? Give feedback.
-
|
Well that was fun! I've pushed a commit that adds Image.map_pages/2 that will execute a function for each page in an image, then reassemble into a new image and set the page height correctly. I've got a simple doctest for an animated # This image is included in the image repo, please adjust the path to suit in your
# environment
iex> image = Image.open!("./test/support/images/animated.webp", pages: -1)
iex> {:ok, mapped_image} = Image.map_pages(image, &Image.crop(&1, 0, 200, 200, 200))
iex> Image.write(mapped_image, "/path/to/some_place/image.webp")If you then view the image in your browser I believe you will see a an animated cropped image. When I'm comfortable its all working as expected - and potentially test on a Would you consider trying this out and give me your feedback? Just configure |
Beta Was this translation helpful? Give feedback.
-
|
I've added a test for animate GIF images - these also seem to work. |
Beta Was this translation helpful? Give feedback.
-
|
I've published image version 0.38.0 with the following changelog. You'll see the new function Bug Fixes
Enhancements
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello! Thanks for this great library!
I have
.gifand.webpfiles, on which I try to applyImage.thumbnail(image, dims, crop: center)which leads to the animation disappearing. When opening images I passpages: -1. Resizing animated images works correctly.Perhaps
libvipsitself does not currently support this option: libvips/libvips#2668Beta Was this translation helpful? Give feedback.
All reactions