aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/image-utils.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-08-27 14:32:44 +0200
committerChocobozzz <me@florianbigard.com>2021-08-27 15:12:22 +0200
commit41fb13c330de629df2d23379209e79c7af0f2e9a (patch)
tree73bc5a90566406b3910f142beae2a879c1e4265d /server/helpers/image-utils.ts
parent40e7ed0714f96c01e16de3ac971a4b28116294e1 (diff)
downloadPeerTube-41fb13c330de629df2d23379209e79c7af0f2e9a.tar.gz
PeerTube-41fb13c330de629df2d23379209e79c7af0f2e9a.tar.zst
PeerTube-41fb13c330de629df2d23379209e79c7af0f2e9a.zip
esModuleInterop to true
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)