@xuda.io/ai_module 1.1.4792 → 1.1.4794
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 +3 -3
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -5992,7 +5992,7 @@ export const get_profile_avatar = async function (profile_picture, uid, prompt,
|
|
|
5992
5992
|
const uniqueId = Date.now() + '_' + Math.random().toString(36).substring(7);
|
|
5993
5993
|
const tempOutputPath = path.join(tempDir, `output_${uniqueId}.png`);
|
|
5994
5994
|
const { is_user } = metadata;
|
|
5995
|
-
let filename;
|
|
5995
|
+
let filename = email || _id || name;
|
|
5996
5996
|
const detect_real_person_in_image = async function (base64) {
|
|
5997
5997
|
const ret = await submit_chat_gpt_prompt({
|
|
5998
5998
|
uid,
|
|
@@ -6133,7 +6133,6 @@ export const get_profile_avatar = async function (profile_picture, uid, prompt,
|
|
|
6133
6133
|
if (is_user) {
|
|
6134
6134
|
if (business_has_person) {
|
|
6135
6135
|
} else {
|
|
6136
|
-
filename = `${mainCategory}_${subCategory}`;
|
|
6137
6136
|
const ai_avatar_response = await client.images.edit({
|
|
6138
6137
|
model,
|
|
6139
6138
|
image: image_blob_ret.image_blob, //logo
|
|
@@ -6173,6 +6172,7 @@ export const get_profile_avatar = async function (profile_picture, uid, prompt,
|
|
|
6173
6172
|
account_profile_info,
|
|
6174
6173
|
);
|
|
6175
6174
|
} else {
|
|
6175
|
+
filename = `${mainCategory}_${subCategory}`;
|
|
6176
6176
|
imageBase64 = await create_image(
|
|
6177
6177
|
uid,
|
|
6178
6178
|
`
|
|
@@ -6254,7 +6254,7 @@ export const get_profile_avatar = async function (profile_picture, uid, prompt,
|
|
|
6254
6254
|
console.log('Success! Saved →', outputPath);
|
|
6255
6255
|
|
|
6256
6256
|
const ext = 'png';
|
|
6257
|
-
const originalname = `avatar_${normalizeFilename(
|
|
6257
|
+
const originalname = `avatar_${normalizeFilename(filename)}.${ext}`;
|
|
6258
6258
|
|
|
6259
6259
|
const file_obj = {
|
|
6260
6260
|
originalname,
|