Update how image URLs are stored to preserve edits

Adjust image URL storage to consistently use the original URL for all formats when edited images with overlays are present.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: ae4037a0-2a6f-4530-9bac-79b543286bda
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/397bca8c-984f-43ff-841a-10897aeb8140/ae4037a0-2a6f-4530-9bac-79b543286bda/Hpj2VzR
This commit is contained in:
michaelschal committed 2025-10-11 09:54:10 +00:00
1 parent 523412bce4
commit bf07167663
2 files changed
+5 -3

No files matched your search

Binary file not shown.

After

Width:  |  Height:  |  Size: 271 KiB

+5 -3
View File
@@ -684,14 +684,16 @@ export async function registerRoutes(app: Express): Promise<Server> {
); );
// Save to database // Save to database
// IMPORTANT: For edited images with overlays, use originalUrl for ALL formats
// because Cloudinary transformations would recreate versions WITHOUT the overlays
const mediaItem = await storage.createMedia({ const mediaItem = await storage.createMedia({
userId, userId,
type: "image", type: "image",
cloudinaryPublicId: uploadResult.publicId, cloudinaryPublicId: uploadResult.publicId,
originalUrl: uploadResult.originalUrl, originalUrl: uploadResult.originalUrl,
facebookFeedUrl: uploadResult.facebookFeedUrl, facebookFeedUrl: uploadResult.originalUrl, // Use original with overlays
instagramFeedUrl: uploadResult.instagramFeedUrl, instagramFeedUrl: uploadResult.originalUrl, // Use original with overlays
instagramStoryUrl: uploadResult.instagramStoryUrl, instagramStoryUrl: uploadResult.originalUrl, // Use original with overlays
fileName: `edited_${Date.now()}.jpg`, fileName: `edited_${Date.now()}.jpg`,
fileSize: outputBuffer.length, fileSize: outputBuffer.length,
}); });