diff options
author | Chocobozzz <me@florianbigard.com> | 2021-08-27 14:32:44 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-08-27 15:12:22 +0200 |
commit | 41fb13c330de629df2d23379209e79c7af0f2e9a (patch) | |
tree | 73bc5a90566406b3910f142beae2a879c1e4265d /server/helpers/image-utils.ts | |
parent | 40e7ed0714f96c01e16de3ac971a4b28116294e1 (diff) | |
download | PeerTube-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.ts | 6 |
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 @@ | |||
1 | import { copy, readFile, remove, rename } from 'fs-extra' | 1 | import { copy, readFile, remove, rename } from 'fs-extra' |
2 | import * as Jimp from 'jimp' | 2 | import Jimp, { read } from 'jimp' |
3 | import { getLowercaseExtension } from './core-utils' | 3 | import { getLowercaseExtension } from './core-utils' |
4 | import { convertWebPToJPG, processGIF } from './ffmpeg-utils' | 4 | import { convertWebPToJPG, processGIF } from './ffmpeg-utils' |
5 | import { logger } from './logger' | 5 | import { 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) |