aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/thumbnail.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/thumbnail.ts')
-rw-r--r--server/lib/thumbnail.ts17
1 files changed, 10 insertions, 7 deletions
diff --git a/server/lib/thumbnail.ts b/server/lib/thumbnail.ts
index 78d2f69e3..dc86423f8 100644
--- a/server/lib/thumbnail.ts
+++ b/server/lib/thumbnail.ts
@@ -42,15 +42,18 @@ function createVideoMiniatureFromUrl (fileUrl: string, video: MVideoThumbnail, t
42 return createThumbnailFromFunction({ thumbnailCreator, filename, height, width, type, existingThumbnail, fileUrl }) 42 return createThumbnailFromFunction({ thumbnailCreator, filename, height, width, type, existingThumbnail, fileUrl })
43} 43}
44 44
45function createVideoMiniatureFromExisting ( 45function createVideoMiniatureFromExisting (options: {
46 inputPath: string, 46 inputPath: string
47 video: MVideoThumbnail, 47 video: MVideoThumbnail
48 type: ThumbnailType, 48 type: ThumbnailType
49 automaticallyGenerated: boolean, 49 automaticallyGenerated: boolean
50 size?: ImageSize 50 size?: ImageSize
51) { 51 keepOriginal?: boolean
52}) {
53 const { inputPath, video, type, automaticallyGenerated, size, keepOriginal } = options
54
52 const { filename, outputPath, height, width, existingThumbnail } = buildMetadataFromVideo(video, type, size) 55 const { filename, outputPath, height, width, existingThumbnail } = buildMetadataFromVideo(video, type, size)
53 const thumbnailCreator = () => processImage(inputPath, outputPath, { width, height }) 56 const thumbnailCreator = () => processImage(inputPath, outputPath, { width, height }, keepOriginal)
54 57
55 return createThumbnailFromFunction({ thumbnailCreator, filename, height, width, type, automaticallyGenerated, existingThumbnail }) 58 return createThumbnailFromFunction({ thumbnailCreator, filename, height, width, type, automaticallyGenerated, existingThumbnail })
56} 59}