aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/image-utils.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/helpers/image-utils.ts')
-rw-r--r--server/helpers/image-utils.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/server/helpers/image-utils.ts b/server/helpers/image-utils.ts
index c76ed545b..033be2c50 100644
--- a/server/helpers/image-utils.ts
+++ b/server/helpers/image-utils.ts
@@ -1,5 +1,5 @@
1import { copy, readFile, remove, rename } from 'fs-extra' 1import { copy, readFile, remove, rename } from 'fs-extra'
2import * as Jimp from 'jimp' 2import Jimp, { read } from 'jimp'
3import { getLowercaseExtension } from './core-utils' 3import { getLowercaseExtension } from './core-utils'
4import { convertWebPToJPG, processGIF } from './ffmpeg-utils' 4import { convertWebPToJPG, processGIF } from './ffmpeg-utils'
5import { logger } from './logger' 5import { logger } from './logger'
@@ -47,7 +47,7 @@ async function jimpProcessor (path: string, destination: string, newSize: { widt
47 const inputBuffer = await readFile(path) 47 const inputBuffer = await readFile(path)
48 48
49 try { 49 try {
50 jimpInstance = await Jimp.read(inputBuffer) 50 jimpInstance = await read(inputBuffer)
51 } catch (err) { 51 } catch (err) {
52 logger.debug('Cannot read %s with jimp. Try to convert the image using ffmpeg first.', path, { err }) 52 logger.debug('Cannot read %s with jimp. Try to convert the image using ffmpeg first.', path, { err })
53 53
@@ -55,7 +55,7 @@ async function jimpProcessor (path: string, destination: string, newSize: { widt
55 await convertWebPToJPG(path, newName) 55 await convertWebPToJPG(path, newName)
56 await rename(newName, path) 56 await rename(newName, path)
57 57
58 jimpInstance = await Jimp.read(path) 58 jimpInstance = await read(path)
59 } 59 }
60 60
61 await remove(destination) 61 await remove(destination)