Update index.js
Browse files
index.js
CHANGED
@@ -103,7 +103,8 @@ app.post("/api/v1/fluxai-ai", async (req, res) => {
|
|
103 |
if (!imageBytes) {
|
104 |
return res.status(500).json({ error: "Failed to fetch image bytes" });
|
105 |
}
|
106 |
-
const
|
|
|
107 |
.jpeg()
|
108 |
.toBuffer();
|
109 |
res.set("Content-Type", "image/jpeg");
|
|
|
103 |
if (!imageBytes) {
|
104 |
return res.status(500).json({ error: "Failed to fetch image bytes" });
|
105 |
}
|
106 |
+
const buffer = Buffer.from(await imageBytes.arrayBuffer());
|
107 |
+
const processedImage = await sharp(buffer)
|
108 |
.jpeg()
|
109 |
.toBuffer();
|
110 |
res.set("Content-Type", "image/jpeg");
|