mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
feat(erase-object): overhaul object eraser with LaMa inpainting improvements
Update erase-object pipeline, eraser canvas, and inpainting Python script. Add LaMa model download script and update Dockerfile for model support. Update multi-file tool routes for consistency.
This commit is contained in:
@@ -5,6 +5,7 @@ import type { FastifyInstance } from "fastify";
|
||||
import PDFDocument from "pdfkit";
|
||||
import sharp from "sharp";
|
||||
import { z } from "zod";
|
||||
import { autoOrient } from "../../lib/auto-orient.js";
|
||||
import { ensureSharpCompat } from "../../lib/heic-converter.js";
|
||||
import { createWorkspace } from "../../lib/workspace.js";
|
||||
|
||||
@@ -96,8 +97,8 @@ export function registerImageToPdf(app: FastifyInstance) {
|
||||
for (const file of files) {
|
||||
doc.addPage({ size: [pageW, pageH], margin });
|
||||
|
||||
// Decode HEIC/HEIF if needed, then convert to PNG for PDFKit compatibility
|
||||
const compatBuffer = await ensureSharpCompat(file.buffer);
|
||||
// Decode HEIC/HEIF if needed, normalize EXIF orientation, then convert to PNG for PDFKit
|
||||
const compatBuffer = await autoOrient(await ensureSharpCompat(file.buffer));
|
||||
const pngBuffer = await sharp(compatBuffer).png().toBuffer();
|
||||
|
||||
const meta = await sharp(pngBuffer).metadata();
|
||||
|
||||
Reference in New Issue
Block a user