Gitweb links:

...log 
http://git.netsurf-browser.org/libnsgif.git/shortlog/030c31ccd5287813cdd60ff299a577a36900fdda
...commit 
http://git.netsurf-browser.org/libnsgif.git/commit/030c31ccd5287813cdd60ff299a577a36900fdda
...tree 
http://git.netsurf-browser.org/libnsgif.git/tree/030c31ccd5287813cdd60ff299a577a36900fdda

The branch, master has been updated
       via  030c31ccd5287813cdd60ff299a577a36900fdda (commit)
      from  5e815f4923c3c7e0d30ff665896d3331784c243d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commitdiff 
http://git.netsurf-browser.org/libnsgif.git/commit/?id=030c31ccd5287813cdd60ff299a577a36900fdda
commit 030c31ccd5287813cdd60ff299a577a36900fdda
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>

    GIF: Apply minimum frame delay only in nsgif_frame_prepare().
    
    Now the frame info contains the raw delay from the GIF file, without
    the minimum applied.

diff --git a/src/gif.c b/src/gif.c
index fe65352..d4d708f 100644
--- a/src/gif.c
+++ b/src/gif.c
@@ -709,15 +709,13 @@ static nsgif_error nsgif__update_bitmap(
 /**
  * Parse the graphic control extension
  *
- * \param[in] gif    The gif object we're decoding.
- * \param[in] frame  The gif object we're decoding.
+ * \param[in] frame  The gif frame object we're decoding.
  * \param[in] data   The data to decode.
  * \param[in] len    Byte length of data.
  * \return NSGIF_ERR_END_OF_DATA if more data is needed,
  *         NSGIF_OK for success.
  */
 static nsgif_error nsgif__parse_extension_graphic_control(
-               const struct nsgif *gif,
                struct nsgif_frame *frame,
                const uint8_t *data,
                size_t len)
@@ -744,9 +742,6 @@ static nsgif_error nsgif__parse_extension_graphic_control(
        }
 
        frame->info.delay = data[3] | (data[4] << 8);
-       if (frame->info.delay < gif->delay_min) {
-               frame->info.delay = gif->delay_default;
-       }
 
        if (data[2] & GIF_MASK_TRANSPARENCY) {
                frame->info.transparency = true;
@@ -852,7 +847,7 @@ static nsgif_error nsgif__parse_frame_extensions(
                case GIF_EXT_GRAPHIC_CONTROL:
                        if (decode) {
                                ret = nsgif__parse_extension_graphic_control(
-                                               gif, frame,
+                                               frame,
                                                nsgif_data,
                                                nsgif_bytes);
                                if (ret != NSGIF_OK) {
@@ -1688,6 +1683,10 @@ nsgif_error nsgif_frame_prepare(
        gif->frame = frame;
        nsgif__redraw_rect_extend(&gif->frames[frame].info.rect, &rect);
 
+       if (delay < gif->delay_min) {
+               delay = gif->delay_default;
+       }
+
        *frame_new = gif->frame;
        *delay_cs = delay;
        *area = rect;


-----------------------------------------------------------------------

Summary of changes:
 src/gif.c |   13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/src/gif.c b/src/gif.c
index fe65352..d4d708f 100644
--- a/src/gif.c
+++ b/src/gif.c
@@ -709,15 +709,13 @@ static nsgif_error nsgif__update_bitmap(
 /**
  * Parse the graphic control extension
  *
- * \param[in] gif    The gif object we're decoding.
- * \param[in] frame  The gif object we're decoding.
+ * \param[in] frame  The gif frame object we're decoding.
  * \param[in] data   The data to decode.
  * \param[in] len    Byte length of data.
  * \return NSGIF_ERR_END_OF_DATA if more data is needed,
  *         NSGIF_OK for success.
  */
 static nsgif_error nsgif__parse_extension_graphic_control(
-               const struct nsgif *gif,
                struct nsgif_frame *frame,
                const uint8_t *data,
                size_t len)
@@ -744,9 +742,6 @@ static nsgif_error nsgif__parse_extension_graphic_control(
        }
 
        frame->info.delay = data[3] | (data[4] << 8);
-       if (frame->info.delay < gif->delay_min) {
-               frame->info.delay = gif->delay_default;
-       }
 
        if (data[2] & GIF_MASK_TRANSPARENCY) {
                frame->info.transparency = true;
@@ -852,7 +847,7 @@ static nsgif_error nsgif__parse_frame_extensions(
                case GIF_EXT_GRAPHIC_CONTROL:
                        if (decode) {
                                ret = nsgif__parse_extension_graphic_control(
-                                               gif, frame,
+                                               frame,
                                                nsgif_data,
                                                nsgif_bytes);
                                if (ret != NSGIF_OK) {
@@ -1688,6 +1683,10 @@ nsgif_error nsgif_frame_prepare(
        gif->frame = frame;
        nsgif__redraw_rect_extend(&gif->frames[frame].info.rect, &rect);
 
+       if (delay < gif->delay_min) {
+               delay = gif->delay_default;
+       }
+
        *frame_new = gif->frame;
        *delay_cs = delay;
        *area = rect;


-- 
NetSurf GIF Decoder
_______________________________________________
netsurf-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to