@xuda.io/account_module 1.2.268 → 1.2.270
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.
- package/index.mjs +6 -1
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -1555,6 +1555,11 @@ export const get_user_name = async function (uid) {
|
|
|
1555
1555
|
};
|
|
1556
1556
|
|
|
1557
1557
|
const removeBg = async function (req, job_id, headers) {
|
|
1558
|
+
const ASSET_PATH = path.join(process.cwd(), 'assets/imgly-bg');
|
|
1559
|
+
const config = {
|
|
1560
|
+
publicPath: `file://${ASSET_PATH}/`, // Points to your local folder
|
|
1561
|
+
debug: true, // Optional: Logs fetch attempts for debugging
|
|
1562
|
+
};
|
|
1558
1563
|
debugger;
|
|
1559
1564
|
const drive_module = await import(`${module_path}/drive_module/index.mjs`);
|
|
1560
1565
|
const { url } = req;
|
|
@@ -1572,7 +1577,7 @@ const removeBg = async function (req, job_id, headers) {
|
|
|
1572
1577
|
const arrayBuffer = await res.arrayBuffer();
|
|
1573
1578
|
imageBuffer = Buffer.from(arrayBuffer);
|
|
1574
1579
|
}
|
|
1575
|
-
const blob = await removeBackground(imageBuffer);
|
|
1580
|
+
const blob = await removeBackground(imageBuffer, config);
|
|
1576
1581
|
|
|
1577
1582
|
// Convert to buffer and save
|
|
1578
1583
|
const outputBuffer = Buffer.from(await blob.arrayBuffer());
|