randydev commited on
Commit
8ce8afc
·
verified ·
1 Parent(s): e28d3f7

Update index.js

Browse files
Files changed (1) hide show
  1. index.js +2 -1
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 processedImage = await sharp(imageBytes)
 
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");