Improve image display by intelligently focusing on subjects
Implement server-side AI analysis to detect focal points in images, ensuring faces and key subjects are not cut off. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 517dfa7b-26ac-463d-a6e1-a58c6df97188 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: c1dc1745-dcd7-4247-a1e3-8dd414e4592b Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/f209e72a-0939-48fa-84fc-57854de71967/517dfa7b-26ac-463d-a6e1-a58c6df97188/drGbo1a Replit-Helium-Checkpoint-Created: true
This commit is contained in:
@@ -4,6 +4,7 @@ import { storage } from "./storage";
|
||||
import { insertArticleSchema } from "@shared/schema";
|
||||
import { seedDatabase } from "./seed";
|
||||
import { generateDailyHoroscopes, getHoroscopesForToday, getOrGenerateHoroscope } from "./horoscope-generator";
|
||||
import { analyzeAllArticleImages, getCachedFocalPoints } from "./focal-point";
|
||||
import multer from "multer";
|
||||
import path from "path";
|
||||
import fs from "fs";
|
||||
@@ -42,6 +43,16 @@ export async function registerRoutes(
|
||||
console.error("Background horoscope generation failed:", err.message)
|
||||
);
|
||||
|
||||
storage.getArticles().then((articles) => {
|
||||
analyzeAllArticleImages(articles).catch(err =>
|
||||
console.log("[focal-point] Analysis skipped:", err.message)
|
||||
);
|
||||
});
|
||||
|
||||
app.get("/api/focal-points", (_req, res) => {
|
||||
res.json(getCachedFocalPoints());
|
||||
});
|
||||
|
||||
app.get("/api/articles", async (_req, res) => {
|
||||
const articles = await storage.getArticles();
|
||||
res.json(articles);
|
||||
|
||||
Reference in New Issue
Block a user