Add Rust logo pipeline: trim, metrics, knockout and Branding settings

Logos (PNG, JPEG, WebP) are decoded, trimmed to their ink box, downscaled
to 1200 px and re-encoded as a content-addressed print PNG plus a white
knockout variant when the logo has alpha; aspect, ink density, mean colour
and kind (wordmark, mark, tall) are stored with the settings and frozen in
the issue snapshot. Legacy logos are derived at startup. The Arun P logo
PDF shrinks from 334 KB to 92 KB. Settings gains a Branding section with
white and dark previews and a business-name toggle (migration M5).
This commit is contained in:
2026-10-04 06:31:30 +05:30
parent afd07071c3
commit 74ba04e17f
27 changed files with 1615 additions and 37 deletions
+8
View File
@@ -27,6 +27,14 @@ export interface Settings {
renderPrefs: string;
/** Folder of the last export; kept by the backend (saving settings does not change it). */
lastExportDir?: string;
/** The untouched logo file the derived images came from. */
logoOriginalPath: string | null;
/** White-ink variant for dark surfaces; only for logos with transparency. */
logoKnockoutPath: string | null;
/** LogoMeta JSON from the import pipeline; empty until the logo has been through it. */
logoMeta: string;
/** Whether the logo already contains the business name. Automatic means a wordmark does. */
logoIncludesName: "auto" | "yes" | "no";
}
export interface BankAccount {