-
-
Notifications
You must be signed in to change notification settings - Fork 703
Add libnsgif support #1709
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
Add libnsgif support #1709
Conversation
only 1/2 done
it was refusing to load a few GIFs
and make gifload and gifnsload both build for easier testing ... though gifnsload is given higher priority, so it handles vipsheader etc.
and fix a tiny memleak in loadgifns
and remove the old giflib loader
I moved the libnsgif source into the tree and removed the old giflib code, so we now have no external dependencies for GIF load. I added a |
though unfortunately libnsgif seems to have broken DISPOSE_PREVIOUS handling again
Unfortunately it seems libnsgif has non-functioning |
to linnsgif, trying to find the GIF decode bug
@jcupitt Thanks for the patch, I have appied it upstream. http://git.netsurf-browser.org/libnsgif.git/commit/?id=3665353c4da1dfb7b4a1d9fa412f0dec2cb673d2 |
Hi @tlsa, thanks for applying the patch! Hopefully I didn't break some other case :( GIF has to be the worst image format ever :( |
Apologies for not being able to test this earlier, before merging. Using rotating-squares.gif as sample input shows a difference in the reported metadata. Before:
After:
|
The missing --- a/libvips/foreign/nsgifload.c
+++ b/libvips/foreign/nsgifload.c
@@ -285,6 +285,7 @@ vips_foreign_load_nsgif_set_header( VipsForeignLoadNsgif *gif,
vips_image_set_int( image, VIPS_META_N_PAGES,
gif->frame_count_displayable );
vips_image_set_int( image, "gif-loop", gif->anim->loop_count );
+ vips_image_set_int( image, "loop", gif->anim->loop_count );
vips_image_set_array_int( image, "delay", gif->delay, gif->n ); |
Drat, sorry Lovell, I should have tested more carefully. I think it's all fixed with 89c12b0 if you have time to test. |
@jcupitt Your fix looks good, thank you. |
@jcupitt Is it possible to recover from |
Oh interesting, I'm not sure. Do you have an example gif which behaves badly? |
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=32607 is a 23 byte GIF file that claims to be 16448x73536. |
Oh wow OK that's bad. I'm planning to work on jp2k compression in tiff today, so if anyone else has time to fix this, please go ahead! |
See this issue for notes on this PR: #1084
This is probably too late for 8.10. Let's look at this again during the 8.11 cycle.