mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
fix(upscale): auto-orient images before upscaling and improve UI
Fix rotated output by calling autoOrient() before passing images to the Python upscaler, correcting EXIF orientation metadata. Replace 2x/4x buttons with 2x-8x slider plus quick-select buttons (2x, 3x, 4x, 6x, 8x). Remove technical jargon about Real-ESRGAN/Lanczos from the UI and progress bar.
This commit is contained in:
@@ -3,6 +3,7 @@ import { writeFile } from "node:fs/promises";
|
||||
import { basename, join } from "node:path";
|
||||
import { upscale } from "@stirling-image/ai";
|
||||
import type { FastifyInstance, FastifyReply, FastifyRequest } from "fastify";
|
||||
import { autoOrient } from "../../lib/auto-orient.js";
|
||||
import { validateImageBuffer } from "../../lib/file-validation.js";
|
||||
import { createWorkspace } from "../../lib/workspace.js";
|
||||
import { updateSingleFileProgress } from "../progress.js";
|
||||
@@ -54,6 +55,9 @@ export function registerUpscale(app: FastifyInstance) {
|
||||
const settings = settingsRaw ? JSON.parse(settingsRaw) : {};
|
||||
const scale = Number(settings.scale) || 2;
|
||||
|
||||
// Auto-orient to fix EXIF rotation before upscaling
|
||||
fileBuffer = await autoOrient(fileBuffer);
|
||||
|
||||
const jobId = randomUUID();
|
||||
const workspacePath = await createWorkspace(jobId);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user