mirror of
https://github.com/R0m1k3/Socialflow.git
synced 2026-10-23 23:18:12 +02:00
fix: auto-rotate images based on EXIF orientation for Facebook stories
This commit is contained in:
1 parent
6c299b954a
commit
509e36a05e
1 file changed
+3
@@ -62,6 +62,7 @@ export class ImageProcessor {
|
|||||||
const fbFeedFilename = `${baseId}-fb-feed${fileExt}`;
|
const fbFeedFilename = `${baseId}-fb-feed${fileExt}`;
|
||||||
const fbFeedPath = path.join(this.uploadsDir, fbFeedFilename);
|
const fbFeedPath = path.join(this.uploadsDir, fbFeedFilename);
|
||||||
await sharp(buffer)
|
await sharp(buffer)
|
||||||
|
.rotate() // Auto-rotate based on EXIF orientation
|
||||||
.resize(CROP_FORMATS.facebookFeed.width, CROP_FORMATS.facebookFeed.height, {
|
.resize(CROP_FORMATS.facebookFeed.width, CROP_FORMATS.facebookFeed.height, {
|
||||||
fit: "cover",
|
fit: "cover",
|
||||||
position: "center",
|
position: "center",
|
||||||
@@ -73,6 +74,7 @@ export class ImageProcessor {
|
|||||||
const igFeedFilename = `${baseId}-ig-feed${fileExt}`;
|
const igFeedFilename = `${baseId}-ig-feed${fileExt}`;
|
||||||
const igFeedPath = path.join(this.uploadsDir, igFeedFilename);
|
const igFeedPath = path.join(this.uploadsDir, igFeedFilename);
|
||||||
await sharp(buffer)
|
await sharp(buffer)
|
||||||
|
.rotate() // Auto-rotate based on EXIF orientation
|
||||||
.resize(CROP_FORMATS.instagramFeed.width, CROP_FORMATS.instagramFeed.height, {
|
.resize(CROP_FORMATS.instagramFeed.width, CROP_FORMATS.instagramFeed.height, {
|
||||||
fit: "cover",
|
fit: "cover",
|
||||||
position: "center",
|
position: "center",
|
||||||
@@ -84,6 +86,7 @@ export class ImageProcessor {
|
|||||||
const igStoryFilename = `${baseId}-ig-story${fileExt}`;
|
const igStoryFilename = `${baseId}-ig-story${fileExt}`;
|
||||||
const igStoryPath = path.join(this.uploadsDir, igStoryFilename);
|
const igStoryPath = path.join(this.uploadsDir, igStoryFilename);
|
||||||
await sharp(buffer)
|
await sharp(buffer)
|
||||||
|
.rotate() // Auto-rotate based on EXIF orientation
|
||||||
.resize(CROP_FORMATS.instagramStory.width, CROP_FORMATS.instagramStory.height, {
|
.resize(CROP_FORMATS.instagramStory.width, CROP_FORMATS.instagramStory.height, {
|
||||||
fit: "cover",
|
fit: "cover",
|
||||||
position: "center",
|
position: "center",
|
||||||
|
|||||||
Reference in new issue
Block a user