diff --git a/public/gif/constants.js b/public/gif/constants.js index 7912516..c0bc867 100644 --- a/public/gif/constants.js +++ b/public/gif/constants.js @@ -43,6 +43,8 @@ const types = [ "unknownExtensionBlock", "unknownExtensionBlockLabel", "unknownExtensionBlockData", + + "gifTerminator", ].reduce((result, id) => { result[id] = id; return result; diff --git a/public/gif/getNodeUi.js b/public/gif/getNodeUi.js index c82117f..614c1f3 100644 --- a/public/gif/getNodeUi.js +++ b/public/gif/getNodeUi.js @@ -298,6 +298,15 @@ const NODE_UI_FNS = { title: "Unknown Extension Block Data", description: p("TODO"), }), + + // Terminator + + [GifNodeType.gifTerminator]: () => ({ + title: "GIF Terminator", + description: p( + "The terminator is a one-byte block indicating the end of our GIF. We're done!", + ), + }), }; /** diff --git a/public/gif/parseGif.js b/public/gif/parseGif.js index 3c173ac..d4ae67d 100644 --- a/public/gif/parseGif.js +++ b/public/gif/parseGif.js @@ -315,6 +315,10 @@ export default (bytes) => { readerFn = readExtensionBlock; break; case BLOCK_TYPE_TRAILER: + children.push({ + type: GifNodeType.gifTerminator, + bytes: bytes.subarray(offset, offset + 1), + }); break readingBlocks; default: throw new Error(`Unknown GIF block type: ${blockType}`);