diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2022-03-07 19:39:58 +0000 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2022-03-07 19:39:58 +0000 |
commit | 716e0fae9a007e7c3c5d52cfb7354b139f851b6d (patch) | |
tree | edd7ba125204312facdda4639b917b446452060a | |
parent | 8019292b7adabf81794dddf6bcf126d440ab229f (diff) | |
download | libnsgif-716e0fae9a007e7c3c5d52cfb7354b139f851b6d.tar.gz libnsgif-716e0fae9a007e7c3c5d52cfb7354b139f851b6d.tar.bz2 |
Docs: Update README to mention nsgif_data_scan errors.
-rw-r--r-- | README.md | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -49,10 +49,15 @@ Now you can load the GIF source data into the nsgif object with This scans the source data and decodes information about each frame, however it doesn't decode any of the bitmap data for the frames. The client may call -`nsgif_data_scan()` multiple times as source data is fetched. Once the -function has returned `NSGIF_OK` it has enough data to display at least one -frame. The early frames can be decoded before the later frames are scanned. -Frames have to be scanned before they can be decoded. +`nsgif_data_scan()` multiple times as source data is fetched. The early frames +can be decoded before the later frames are scanned. Frames have to be scanned +before they can be decoded. + +This function will sometimes return an error. That is OK, and even expected. +It is fine to proceed to decoding any frames that are available after a scan. +Some errors indicate that there is a flaw in the source GIF data (not at all +uncommon, GIF is an ancient format that has had many broken encoders), or that +it has reached the end of the source data. > **Note**: The client must not free the data until after calling > `nsgif_destroy()`. You can move the data, e.g. if you realloc to a bigger |