mirror of
https://github.com/R0m1k3/Socialflow.git
synced 2026-10-22 22:48:09 +02:00
Add ability to overlay text on images for social media stories
Integrate image processing to add text to story images with dynamic font sizing and text wrapping, and upload generated images to Cloudinary via a new service. Replit-Commit-Author: Agent Replit-Commit-Session-Id: ae4037a0-2a6f-4530-9bac-79b543286bda Replit-Commit-Checkpoint-Type: intermediate_checkpoint Replit-Commit-Event-Id: 4277243d-e609-4ee4-8cbc-3521773fc333 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/397bca8c-984f-43ff-841a-10897aeb8140/ae4037a0-2a6f-4530-9bac-79b543286bda/f2EnhiB
This commit is contained in:
1 parent
c62e59b8f1
commit
b581050eae
3 files changed
+167
-1
No files matched your search
@@ -1,5 +1,7 @@
|
||||
import { storage } from '../storage';
|
||||
import type { Post, SocialPage, Media } from '@shared/schema';
|
||||
import { imageProcessor } from './imageProcessor';
|
||||
import { cloudinaryService } from './cloudinary';
|
||||
|
||||
interface FacebookPhotoResponse {
|
||||
id: string;
|
||||
@@ -316,7 +318,17 @@ export class FacebookService {
|
||||
// Step 1: Upload photo as unpublished to get photo_id
|
||||
// Step 2: Publish the photo as a story using the photo_id
|
||||
|
||||
const photoUrl = media.originalUrl;
|
||||
let photoUrl = media.originalUrl;
|
||||
|
||||
if (post.content && post.content.trim().length > 0) {
|
||||
try {
|
||||
const imageWithText = await imageProcessor.addTextToStoryImage(media.originalUrl, post.content);
|
||||
photoUrl = await cloudinaryService.uploadStoryImageWithText(imageWithText, `story-${media.id}.png`);
|
||||
console.log('Story image with text generated:', photoUrl);
|
||||
} catch (error) {
|
||||
console.error('Error generating story image with text, using original:', error);
|
||||
}
|
||||
}
|
||||
|
||||
// Step 1: Upload photo as unpublished
|
||||
const uploadParams = new URLSearchParams({
|
||||
|
||||
Reference in new issue
Block a user