-
-
Notifications
You must be signed in to change notification settings - Fork 702
cgifsave: Make loop counts more accurate #2709
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
Conversation
Hi @TheEssem, The libvips Instead of a flag, how about automatically setting |
Ah, I see. Fixed. |
I tested it a bit. It looks like the GIF loader needs a matching change :/ I thought it had this logic in already. |
Patched nsgif to (hopefully) fix it, let me know if there's a more elegant solution. |
I don't think we should patch libnsgif unless there's really no choice. I'll see if there's some way to do it within the libnsgif API. |
Oh heh you're right, there's no way to do this and stay in the API. What do you think, @tlsa? It looks like we need to change the way libnsgif reports
I think 3. is the case that libnsgif is currently missing. |
This reverts commit 77550f0.
The libnsgif change has helped a lot, now we need to make it work with cgif 0.2 (the version that's used for testing, since 0.3 isn't out yet). We'll need a test in |
Eg. something like: cgif_dep = disabler()
if quantisation_package.found()
cgif_dep = dependency('cgif', version: '>=0.2.0', required: get_option('cgif'))
if cgif_dep.found()
libvips_deps += cgif_dep
cfg_var.set('HAVE_CGIF', '1')
if cc.compiles('#include <cgif.h>\nint i = CGIF_ATTR_NO_LOOP;', name: 'Has CGIF_ATTR_NO_LOOP', dependencies: cgif_dep)
cfg_var.set('HAVE_CGIF_ATTR_NO_LOOP', '1')
endif
endif
endif Then you can add an |
How exactly would the |
Yes, I suppose so, unless you can think of something better. |
I think you don't need a So you can just check |
My code scrap was gated on 0.2+ I think, so you would need to test for The usual principle is to test for features rather than version numbers where possible. Version number tests can fail if features get backported, for example. |
Oh, I misread your comment, sorry. Sure, we could use |
OK, tests are passing, let's merge! Thank you for doing this work, @TheEssem. |
I don't see any rationale for supporting people who backport API/ABI breakages, since that's really just another way of saying "they have hard forked the project and decided to do their own thing that isn't expected to be compatible". But, do you have an example of people doing this... I'm sorry, incredibly hostile action by deliberately screwing over users? :) |
I think the example you see most often is ImageMagick :( They have a sad history of adding and removing API on minor version number changes, and also backporting. A single scalar isn't enough to represent an IM version number, you need at least (x + iy) hehe. I think they are trying harder with im7 to provide a supported API, so perhaps it's not the issue it was. You know a lot more than me about this of course, maybe I'm being overly cautious. |
See dloebl/cgif#46 and dloebl/cgif#48.
This fixes cgifsave to make the libvips
loop
property specify the number of iterations instead of the number of times an animation loops. Depends on (the currently unreleased) CGIF version 0.3.0.