Initial commit of stand-alone animated gif library stb_gif.h #1025
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As requested by STB (https://twitter.com/nothings/status/1298821179206115328) I have refactored the animated GIF code out of stb_image.h and into its own library, called stb_gif.h
The code is basically the same, with changes to the API to make it more directly interact with the animated GIF loading code.
stbgif_load() loads a GIF with all of its layers
compare to stbi_load() in stb_image.h that loads a single layer.
The functionality of stbi_load() on a GIF format image exists in this file as stbgif__load_first_layer()
stbgif_info() determines the x and y dimensions of the GIF, and the number of components (3-4). This mirrors the functionality of stbi_info() in stb_image.h
Adding a feature to read the comment extension to determine the number of layers is left as future work.