mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
feat: add HEIC/HEIF format support for input and output
Add bidirectional HEIC support using system libheif CLI tools (heif-enc/heif-dec) for HEVC encoding/decoding, since Sharp's bundled libheif only supports AV1. - HEIC input: all tools now accept iPhone HEIC photos via heif-dec pre-processing - HEIC output: convert tool produces true HEIC (HEVC) via heif-enc - Docker: adds libheif-examples package for heif-enc/heif-dec CLI tools - Tests: full conversion matrix (7x7), unit tests, and Playwright e2e tests - Docs: updated OpenAPI spec, image-engine docs, getting-started, llms-full.txt
This commit is contained in:
@@ -15,7 +15,7 @@ import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from
|
||||
const FIXTURES = join(__dirname, "..", "fixtures");
|
||||
|
||||
// Output formats accepted by the convert tool
|
||||
const OUTPUT_FORMATS = ["jpg", "png", "webp", "avif", "tiff", "gif"] as const;
|
||||
const OUTPUT_FORMATS = ["jpg", "png", "webp", "avif", "tiff", "gif", "heic"] as const;
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Shared state
|
||||
@@ -62,6 +62,11 @@ beforeAll(async () => {
|
||||
filename: "test.gif",
|
||||
contentType: "image/gif",
|
||||
};
|
||||
inputs.heic = {
|
||||
buffer: readFileSync(join(FIXTURES, "test-200x150.heic")),
|
||||
filename: "test.heic",
|
||||
contentType: "image/heic",
|
||||
};
|
||||
inputs.svg = {
|
||||
buffer: readFileSync(join(FIXTURES, "test-100x100.svg")),
|
||||
filename: "test.svg",
|
||||
@@ -77,7 +82,7 @@ afterAll(async () => {
|
||||
// Raster-to-raster conversions via /api/v1/tools/convert
|
||||
// ---------------------------------------------------------------------------
|
||||
describe("Format conversion matrix", () => {
|
||||
const rasterInputs = ["png", "jpg", "webp", "avif", "tiff", "gif"];
|
||||
const rasterInputs = ["png", "jpg", "webp", "avif", "tiff", "gif", "heic"];
|
||||
|
||||
for (const inputFmt of rasterInputs) {
|
||||
for (const outputFmt of OUTPUT_FORMATS) {
|
||||
|
||||
Reference in New Issue
Block a user