@xuda.io/account_module 1.2.252 → 1.2.253
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 +7 -2
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -1567,10 +1567,15 @@ const removeBg = async function (req, job_id, headers) {
|
|
|
1567
1567
|
// Convert to buffer and save
|
|
1568
1568
|
const outputBuffer = Buffer.from(await blob.arrayBuffer());
|
|
1569
1569
|
|
|
1570
|
-
|
|
1570
|
+
fs.writeFileSync(outputPath, outputBuffer);
|
|
1571
1571
|
|
|
1572
|
-
|
|
1572
|
+
const file_obj = {
|
|
1573
|
+
originalname: originalname,
|
|
1574
|
+
path: tempPath,
|
|
1575
|
+
mimetype: `image/${ext}`,
|
|
1576
|
+
};
|
|
1573
1577
|
|
|
1578
|
+
const drive_ret = await drive_module.upload_drive_file_user({ uid, path: '/Profile Images' }, job_id, headers, file_obj);
|
|
1574
1579
|
console.log(`Background removed! Saved to ${outputPath}`);
|
|
1575
1580
|
} catch (error) {
|
|
1576
1581
|
console.error('Error:', error);
|