mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
feat: add AVIF output format support across 6 remaining tools (#85)
Closes #73 AVIF was already supported in the core engine, convert, compress, optimize-for-web, upscale, erase-object, svg-to-raster, and pdf-to-image tools. This adds AVIF as an output format option to the 6 tools that were missing it: split, collage, stitch, image-to-base64, noise-removal, and red-eye-removal. For each tool, both the frontend format selector (with quality slider for AVIF's lossy encoding) and the backend Zod schema + Sharp .avif() encoding were updated. AVIF defaults: quality from the user slider, effort 4 (balanced encode speed). Also fixes pre-existing Biome formatting violations in 5 files that were blocking a clean lint pass.
This commit is contained in:
@@ -3,7 +3,7 @@ import { COLLAGE_TEMPLATES, getDefaultTemplate } from "@/lib/collage-templates";
|
||||
import { fetchDecodedPreview, needsServerPreview, revokePreviewUrl } from "@/lib/image-preview";
|
||||
|
||||
export type AspectRatio = "free" | "1:1" | "4:3" | "3:2" | "16:9" | "9:16" | "4:5";
|
||||
export type OutputFormat = "png" | "jpeg" | "webp";
|
||||
export type OutputFormat = "png" | "jpeg" | "webp" | "avif";
|
||||
export type Phase = "upload" | "editing" | "processing" | "result";
|
||||
|
||||
export interface CollageImage {
|
||||
|
||||
@@ -18,7 +18,7 @@ interface SplitState {
|
||||
rows: number;
|
||||
tileWidth: number;
|
||||
tileHeight: number;
|
||||
outputFormat: "original" | "png" | "jpg" | "webp";
|
||||
outputFormat: "original" | "png" | "jpg" | "webp" | "avif";
|
||||
quality: number;
|
||||
|
||||
// Image dimensions (set when image loads in the canvas)
|
||||
@@ -36,7 +36,7 @@ interface SplitState {
|
||||
setRows: (n: number) => void;
|
||||
setTileWidth: (n: number) => void;
|
||||
setTileHeight: (n: number) => void;
|
||||
setOutputFormat: (f: "original" | "png" | "jpg" | "webp") => void;
|
||||
setOutputFormat: (f: "original" | "png" | "jpg" | "webp" | "avif") => void;
|
||||
setQuality: (q: number) => void;
|
||||
setImageDimensions: (d: { width: number; height: number } | null) => void;
|
||||
setProcessing: (p: boolean) => void;
|
||||
|
||||
Reference in New Issue
Block a user