diff options
Diffstat (limited to 'server/helpers/image-utils.ts')
-rw-r--r-- | server/helpers/image-utils.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/server/helpers/image-utils.ts b/server/helpers/image-utils.ts index bbd4692ef..05b258d8a 100644 --- a/server/helpers/image-utils.ts +++ b/server/helpers/image-utils.ts | |||
@@ -3,7 +3,7 @@ import Jimp, { read as jimpRead } from 'jimp' | |||
3 | import { join } from 'path' | 3 | import { join } from 'path' |
4 | import { getLowercaseExtension } from '@shared/core-utils' | 4 | import { getLowercaseExtension } from '@shared/core-utils' |
5 | import { buildUUID } from '@shared/extra-utils' | 5 | import { buildUUID } from '@shared/extra-utils' |
6 | import { convertWebPToJPG, generateThumbnailFromVideo, processGIF } from './ffmpeg/ffmpeg-images' | 6 | import { convertWebPToJPG, generateThumbnailFromVideo, processGIF } from './ffmpeg' |
7 | import { logger, loggerTagsFactory } from './logger' | 7 | import { logger, loggerTagsFactory } from './logger' |
8 | 8 | ||
9 | const lTags = loggerTagsFactory('image-utils') | 9 | const lTags = loggerTagsFactory('image-utils') |
@@ -30,7 +30,7 @@ async function processImage (options: { | |||
30 | 30 | ||
31 | // Use FFmpeg to process GIF | 31 | // Use FFmpeg to process GIF |
32 | if (extension === '.gif') { | 32 | if (extension === '.gif') { |
33 | await processGIF(path, destination, newSize) | 33 | await processGIF({ path, destination, newSize }) |
34 | } else { | 34 | } else { |
35 | await jimpProcessor(path, destination, newSize, extension) | 35 | await jimpProcessor(path, destination, newSize, extension) |
36 | } | 36 | } |
@@ -50,7 +50,7 @@ async function generateImageFromVideoFile (options: { | |||
50 | const pendingImagePath = join(folder, pendingImageName) | 50 | const pendingImagePath = join(folder, pendingImageName) |
51 | 51 | ||
52 | try { | 52 | try { |
53 | await generateThumbnailFromVideo(fromPath, folder, imageName) | 53 | await generateThumbnailFromVideo({ fromPath, folder, imageName }) |
54 | 54 | ||
55 | const destination = join(folder, imageName) | 55 | const destination = join(folder, imageName) |
56 | await processImage({ path: pendingImagePath, destination, newSize: size }) | 56 | await processImage({ path: pendingImagePath, destination, newSize: size }) |
@@ -99,7 +99,7 @@ async function jimpProcessor (path: string, destination: string, newSize: { widt | |||
99 | logger.debug('Cannot read %s with jimp. Try to convert the image using ffmpeg first.', path, { err }) | 99 | logger.debug('Cannot read %s with jimp. Try to convert the image using ffmpeg first.', path, { err }) |
100 | 100 | ||
101 | const newName = path + '.jpg' | 101 | const newName = path + '.jpg' |
102 | await convertWebPToJPG(path, newName) | 102 | await convertWebPToJPG({ path, destination: newName }) |
103 | await rename(newName, path) | 103 | await rename(newName, path) |
104 | 104 | ||
105 | sourceImage = await jimpRead(path) | 105 | sourceImage = await jimpRead(path) |