From 3a54605d4e7ec5b4f47131e8d23255be35b7beac Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 27 Jun 2022 11:53:12 +0200 Subject: Process images in a dedicated worker --- server/tests/helpers/image.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'server/tests/helpers') diff --git a/server/tests/helpers/image.ts b/server/tests/helpers/image.ts index 475ca8fb2..7c5da69b5 100644 --- a/server/tests/helpers/image.ts +++ b/server/tests/helpers/image.ts @@ -37,28 +37,28 @@ describe('Image helpers', function () { it('Should skip processing if the source image is okay', async function () { const input = buildAbsoluteFixturePath('thumbnail.jpg') - await processImage(input, imageDestJPG, thumbnailSize, true) + await processImage({ path: input, destination: imageDestJPG, newSize: thumbnailSize, keepOriginal: true }) await checkBuffers(input, imageDestJPG, true) }) it('Should not skip processing if the source image does not have the appropriate extension', async function () { const input = buildAbsoluteFixturePath('thumbnail.png') - await processImage(input, imageDestJPG, thumbnailSize, true) + await processImage({ path: input, destination: imageDestJPG, newSize: thumbnailSize, keepOriginal: true }) await checkBuffers(input, imageDestJPG, false) }) it('Should not skip processing if the source image does not have the appropriate size', async function () { const input = buildAbsoluteFixturePath('preview.jpg') - await processImage(input, imageDestJPG, thumbnailSize, true) + await processImage({ path: input, destination: imageDestJPG, newSize: thumbnailSize, keepOriginal: true }) await checkBuffers(input, imageDestJPG, false) }) it('Should not skip processing if the source image does not have the appropriate size', async function () { const input = buildAbsoluteFixturePath('thumbnail-big.jpg') - await processImage(input, imageDestJPG, thumbnailSize, true) + await processImage({ path: input, destination: imageDestJPG, newSize: thumbnailSize, keepOriginal: true }) await checkBuffers(input, imageDestJPG, false) }) @@ -67,7 +67,7 @@ describe('Image helpers', function () { const input = buildAbsoluteFixturePath('exif.jpg') expect(await hasTitleExif(input)).to.be.true - await processImage(input, imageDestJPG, { width: 100, height: 100 }, true) + await processImage({ path: input, destination: imageDestJPG, newSize: { width: 100, height: 100 }, keepOriginal: true }) await checkBuffers(input, imageDestJPG, false) expect(await hasTitleExif(imageDestJPG)).to.be.false @@ -77,7 +77,7 @@ describe('Image helpers', function () { const input = buildAbsoluteFixturePath('exif.jpg') expect(await hasTitleExif(input)).to.be.true - await processImage(input, imageDestJPG, thumbnailSize, true) + await processImage({ path: input, destination: imageDestJPG, newSize: thumbnailSize, keepOriginal: true }) await checkBuffers(input, imageDestJPG, false) expect(await hasTitleExif(imageDestJPG)).to.be.false @@ -87,7 +87,7 @@ describe('Image helpers', function () { const input = buildAbsoluteFixturePath('exif.png') expect(await hasTitleExif(input)).to.be.true - await processImage(input, imageDestPNG, thumbnailSize, true) + await processImage({ path: input, destination: imageDestPNG, newSize: thumbnailSize, keepOriginal: true }) expect(await hasTitleExif(imageDestPNG)).to.be.false }) -- cgit v1.2.3