mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
Adds a dedicated remove-gif-background AI tool: removes the background from an animated GIF, WebP, or APNG frame by frame and reassembles a transparent (or composited) animation in WebP, APNG, or GIF, with full per-frame effects. Reuses the background-removal bundle. Verified end-to-end with the real rembg model. Closes #496.
18 lines
638 B
TypeScript
18 lines
638 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { apngFrameCount } from "../../../apps/api/src/lib/apng.js";
|
|
import { fixtures, readFixture } from "../../fixtures/index.js";
|
|
|
|
describe("apngFrameCount", () => {
|
|
it("returns null for a non-PNG buffer", () => {
|
|
expect(apngFrameCount(Buffer.from("GIF89a-not-a-png-file"))).toBeNull();
|
|
});
|
|
|
|
it("returns 1 for a still PNG (no acTL)", () => {
|
|
expect(apngFrameCount(readFixture(fixtures.image.base.png200))).toBe(1);
|
|
});
|
|
|
|
it("returns the frame count for a multi-frame APNG", () => {
|
|
expect(apngFrameCount(readFixture(fixtures.image.animated.apng))).toBe(4);
|
|
});
|
|
});
|