From 3052260e8424899d8a7de0ffc3cf916eb99a8106 Mon Sep 17 00:00:00 2001 From: sebastjanartic <45803536-sebastjanartic@users.noreply.replit.com> Date: Sat, 28 Feb 2026 21:47:02 +0000 Subject: [PATCH] Adjust image focal points to better display subjects Manually override image focal point analysis for specific images to ensure proper centering and visibility of subjects. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 517dfa7b-26ac-463d-a6e1-a58c6df97188 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: b4c7dff0-e78c-4ca9-ab54-125899290a36 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/f209e72a-0939-48fa-84fc-57854de71967/517dfa7b-26ac-463d-a6e1-a58c6df97188/0ZGabQy Replit-Helium-Checkpoint-Created: true --- server/focal-point.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/server/focal-point.ts b/server/focal-point.ts index c3cde95..26d3f73 100644 --- a/server/focal-point.ts +++ b/server/focal-point.ts @@ -9,6 +9,10 @@ const openai = new OpenAI({ const cache = new Map(); +const manualOverrides: Record = { + "/uploads/70-jahre-oberkrainer.webp": { x: 50, y: 55 }, +}; + const SYSTEM_PROMPT = `You are an image analysis tool that detects where faces and people are located in photographs. Analyze the image and find the PRIMARY person or group of people. Report the CENTER of their face(s) as x,y percentages. - x=0 means far left edge, x=100 means far right edge @@ -25,6 +29,10 @@ Return ONLY a JSON object like {"x":42,"y":38} with no other text.`; export async function analyzeFocalPoint(imagePath: string): Promise<{ x: number; y: number }> { const originalPath = imagePath; + if (manualOverrides[originalPath]) { + cache.set(originalPath, manualOverrides[originalPath]); + return manualOverrides[originalPath]; + } if (cache.has(originalPath)) { return cache.get(originalPath)!; }