GIF: parse terminator
This commit is contained in:
parent
e0a2a3287b
commit
40c7091386
|
@ -43,6 +43,8 @@ const types = [
|
|||
"unknownExtensionBlock",
|
||||
"unknownExtensionBlockLabel",
|
||||
"unknownExtensionBlockData",
|
||||
|
||||
"gifTerminator",
|
||||
].reduce((result, id) => {
|
||||
result[id] = id;
|
||||
return result;
|
||||
|
|
|
@ -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!",
|
||||
),
|
||||
}),
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -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}`);
|
||||
|
|
Loading…
Reference in New Issue