import 'multer'
import { queue } from 'async'
-import * as LRUCache from 'lru-cache'
-import { extname, join } from 'path'
-import { v4 as uuidv4 } from 'uuid'
+import LRUCache from 'lru-cache'
+import { join } from 'path'
+import { getLowercaseExtension } from '@server/helpers/core-utils'
+import { buildUUID } from '@server/helpers/uuid'
import { ActorModel } from '@server/models/actor/actor'
import { ActivityPubActorType, ActorImageType } from '@shared/models'
import { retryTransactionWrapper } from '../helpers/database-utils'
? ACTOR_IMAGES_SIZE.AVATARS
: ACTOR_IMAGES_SIZE.BANNERS
- const extension = extname(imagePhysicalFile.filename)
+ const extension = getLowercaseExtension(imagePhysicalFile.filename)
- const imageName = uuidv4() + extension
+ const imageName = buildUUID() + extension
const destination = join(CONFIG.STORAGE.ACTOR_IMAGES, imageName)
await processImage(imagePhysicalFile.path, destination, imageSize)