Can't save image as a GIF?
RiskoZoSlovenska opened this issue · comments
Hello,
I've recently been playing around with libvips and all has gone smoothly save for one issue: I can't seem to be able to save a GIF image back to file after reading it; I get a VipsForeignSave: "test2.gif" is not a known file format
error.
That error is being raised by this code:
local vips = require("vips")
local image = vips.Image.new_from_file("test.gif", {n = -1})
image:write_to_file("test2.gif")
Additionally, I also tried running a code sample provided in a different issue, only to get the same result.
Reading the GIF and saving it to other formats (PNG) works. I've also tried to use magicksave()
local vips = require("vips")
local image = vips.Image.new_from_file("test.gif", {n = -1})
image:magicksave("test2.gif")
but that gives me a no such operation
error.
Is this a limitation of the Lua binding? Am I doing something wrong?
My libvips version is 8.10.2.
Thanks in advance!
Hi @RiskoZoSlovenska, it sounds like your libvips has been built without libmagick support.
You'll need to install imagemagick-dev and then reconfigure and rebuild libvips.
Apologies for the absurdly long radio silence. I see a gif saver has been added at some point since I asked this (yay!), and as such I no longer have a problem. Thanks!
Yes, libvips 8.12 has its own GIF saver now. There are some notes and a benchmark here: