lua-vips icon indicating copy to clipboard operation
lua-vips copied to clipboard

Gif not saving properly

Open superjaja05 opened this issue 1 year ago • 7 comments

Hello, i'm having an issue with gif saving i load a gif using local base = vips.Image.new_from_file("base.gif", {n=-1}) , then i save it again using base:write_to_file("base2.gif") (just for testing) And it seems that the base2 gif (the 2nd save) tries to "stack" the frames to save in file size, since nothing moves, but instead of actually stacking.. It just glitches out and become a transparent mess, any idea how i could fix that?

base base2

superjaja05 avatar Jul 04 '24 00:07 superjaja05

Hello @superjaja05, is this an old version of libvips? I tried with current stable (8.15.2):

$ vips copy base.gif[n=-1] base2.gif
$ vips --version
vips-8.15.2

To make:

base2

jcupitt avatar Jul 04 '24 01:07 jcupitt

I'm not sure how to check my version, but yes it might be an old version, though i don't know how to update it (i use a fork of lua-vips, https://github.com/Bilal2453/lit-vips , but it hasn't been updated in a while and i don't know how to manually update it, if i even can)

superjaja05 avatar Jul 04 '24 15:07 superjaja05

What platform is this? If it's linux, just updating your OS should fix it.

jcupitt avatar Jul 04 '24 16:07 jcupitt

Oh, if you're on windows, the regular lua-vips works pretty well now, there's no need to use a fork. It also supports plain lua as well as luajit.

jcupitt avatar Jul 04 '24 16:07 jcupitt

I'm not sure if i can use lua-vips with luvit though?

superjaja05 avatar Jul 05 '24 00:07 superjaja05

@superjaja05 Luvit can handle Luarocks dependencies just fine as long as you have Luarocks set up - they just won't show up as dependencies if you ever package your project for lit. I've been using lua-vips with Luvit without issue for a while now.

If you really need lit support, it shouldn't be too hard to open a PR (or at least an issue) on the lit-vips repo.

RiskoZoSlovenska avatar Jul 05 '24 08:07 RiskoZoSlovenska

Well the issue is i don't know how to use Luarocks, i always get errors and i can't figure out how to fix them

superjaja05 avatar Jul 05 '24 22:07 superjaja05

I'm not sure how to check my version, but yes it might be an old version, though i don't know how to update it (i use a fork of lua-vips, https://github.com/Bilal2453/lit-vips , but it hasn't been updated in a while and i don't know how to manually update it, if i even can)

According to https://github.com/Bilal2453/lit-vips/blob/master/Windows-x64/versions.json you are using libvips in version 8.12.1, which is from Nov 2021, so indeed quite old.

If you have trouble setting up Luarocks (and lua-vips on top), you could try to follow the MSYS2 way detailed in https://github.com/libvips/lua-vips?tab=readme-ov-file#running-on-windows-using-mingw-w64

I'm closing the issue, since I don't think we can do something from the lua-vips side to help you.

rolandlo avatar Dec 20 '24 17:12 rolandlo