@xuda.io/ai_module 1.1.4791 → 1.1.4793
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 -1
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -5992,6 +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 = email || _id || name;
|
|
5995
5996
|
const detect_real_person_in_image = async function (base64) {
|
|
5996
5997
|
const ret = await submit_chat_gpt_prompt({
|
|
5997
5998
|
uid,
|
|
@@ -6171,6 +6172,7 @@ export const get_profile_avatar = async function (profile_picture, uid, prompt,
|
|
|
6171
6172
|
account_profile_info,
|
|
6172
6173
|
);
|
|
6173
6174
|
} else {
|
|
6175
|
+
filename = `${mainCategory}_${subCategory}`;
|
|
6174
6176
|
imageBase64 = await create_image(
|
|
6175
6177
|
uid,
|
|
6176
6178
|
`
|
|
@@ -6252,7 +6254,7 @@ export const get_profile_avatar = async function (profile_picture, uid, prompt,
|
|
|
6252
6254
|
console.log('Success! Saved →', outputPath);
|
|
6253
6255
|
|
|
6254
6256
|
const ext = 'png';
|
|
6255
|
-
const originalname = `avatar_${normalizeFilename(
|
|
6257
|
+
const originalname = `avatar_${normalizeFilename(filename)}.${ext}`;
|
|
6256
6258
|
|
|
6257
6259
|
const file_obj = {
|
|
6258
6260
|
originalname,
|