]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/helpers/image-utils.ts
Update server dependencies
[github/Chocobozzz/PeerTube.git] / server / helpers / image-utils.ts
index 05b258d8ab0ca7897fe8e5324ac8e57d208109a3..f86f7216d81d0161cf803f0a18026e27c2f5ae83 100644 (file)
@@ -1,6 +1,7 @@
 import { copy, readFile, remove, rename } from 'fs-extra'
 import Jimp, { read as jimpRead } from 'jimp'
 import { join } from 'path'
+import { ColorActionName } from '@jimp/plugin-color'
 import { getLowercaseExtension } from '@shared/core-utils'
 import { buildUUID } from '@shared/extra-utils'
 import { convertWebPToJPG, generateThumbnailFromVideo, processGIF } from './ffmpeg'
@@ -131,7 +132,7 @@ async function autoResize (options: {
 
   if (sourceIsPortrait && !destIsPortraitOrSquare) {
     const baseImage = sourceImage.cloneQuiet().cover(newSize.width, newSize.height)
-                                              .color([ { apply: 'shade', params: [ 50 ] } ])
+                                              .color([ { apply: ColorActionName.SHADE, params: [ 50 ] } ])
 
     const topImage = sourceImage.cloneQuiet().contain(newSize.width, newSize.height)