Skip to content

Commit 428a1bb

Browse files
matmenclaude
andcommitted
reference the APNG specification
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ljnxm1Qjrocq1izGajLx8J
1 parent 4eda0a7 commit 428a1bb

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎src/codecs/png.ts‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,8 @@ export function isAnimated(array: Uint8Array): boolean {
556556
}
557557

558558
/**
559-
* Decodes an APNG into its (uncomposited) frames; a plain PNG becomes a single frame
559+
* Decodes an APNG (https://wiki.mozilla.org/APNG_Specification) into its (uncomposited) frames; a plain PNG becomes
560+
* a single frame
560561
* @return plays: 0 = forever
561562
*/
562563
export async function decodeAnimation(array: Uint8Array, onlyFirstFrame = false): Promise<{ width: number, height: number, plays: number, frames: APNGFrame[] }> {
@@ -586,7 +587,8 @@ export async function decodeAnimation(array: Uint8Array, onlyFirstFrame = false)
586587
}
587588

588589
/**
589-
* Composites APNG frames onto the canvas, as the APNG specification describes (its integer "over" operation)
590+
* Composites APNG frames onto the canvas, as the APNG specification describes (the integer "over" operation of its
591+
* blend_op section, https://wiki.mozilla.org/APNG_Specification)
590592
*/
591593
export function compositeAnimation({ width, height, frames }: { width: number, height: number, frames: APNGFrame[] }): Array<{ pixels: Uint8Array, duration: number }> {
592594
const canvas = new Uint8Array(width * height * 4);

0 commit comments

Comments
 (0)