@xuda.io/account_module 1.2.254 → 1.2.255

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.mjs +3 -3
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -1555,7 +1555,7 @@ const removeBg = async function (req, job_id, headers) {
1555
1555
  // }
1556
1556
 
1557
1557
  if (url) {
1558
- const res = await fetch(imgObj.url);
1558
+ const res = await fetch(url);
1559
1559
  if (!res.ok) {
1560
1560
  throw new Error(`Failed to fetch image URL: ${res.status} ${res.statusText}`);
1561
1561
  }
@@ -1568,9 +1568,9 @@ const removeBg = async function (req, job_id, headers) {
1568
1568
  const outputBuffer = Buffer.from(await blob.arrayBuffer());
1569
1569
  const tempPath = path.join(os.tmpdir(), Date.now());
1570
1570
  fs.writeFileSync(tempPath, outputBuffer);
1571
-
1571
+ const originalname = path.basename(url);
1572
1572
  const file_obj = {
1573
- originalname: originalname,
1573
+ originalname,
1574
1574
  path: tempPath,
1575
1575
  mimetype: `image/${ext}`,
1576
1576
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/account_module",
3
- "version": "1.2.254",
3
+ "version": "1.2.255",
4
4
  "description": "Xuda Account Server Module",
5
5
  "main": "index.mjs",
6
6
  "dependencies": {