From 84531547bc0934a2abda586d539f7455b455d488 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 8 Apr 2021 11:23:45 +0200 Subject: Add size info in db for actor images --- server/helpers/image-utils.ts | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'server/helpers') diff --git a/server/helpers/image-utils.ts b/server/helpers/image-utils.ts index 9285c12fc..6f6f8d4da 100644 --- a/server/helpers/image-utils.ts +++ b/server/helpers/image-utils.ts @@ -1,9 +1,14 @@ import { copy, readFile, remove, rename } from 'fs-extra' import * as Jimp from 'jimp' import { extname } from 'path' +import { v4 as uuidv4 } from 'uuid' import { convertWebPToJPG, processGIF } from './ffmpeg-utils' import { logger } from './logger' +function generateImageFilename (extension = '.jpg') { + return uuidv4() + extension +} + async function processImage ( path: string, destination: string, @@ -31,6 +36,7 @@ async function processImage ( // --------------------------------------------------------------------------- export { + generateImageFilename, processImage } -- cgit v1.2.3