Use streams to download attachments directly to disk

Co-authored-by: trevor-signal <131492920+trevor-signal@users.noreply.github.com>
This commit is contained in:
Scott Nonnenberg 2023-10-30 09:24:28 -07:00 committed by GitHub
parent 2da49456c6
commit 99b2bc304e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
48 changed files with 2297 additions and 356 deletions

View file

@ -35,7 +35,12 @@ describe('scaleImageToLevel', () => {
testCases.map(
async ({ path, contentType, expectedWidth, expectedHeight }) => {
const blob = await getBlob(path);
const scaled = await scaleImageToLevel(blob, contentType, true);
const scaled = await scaleImageToLevel(
blob,
contentType,
blob.size,
true
);
const data = await loadImage(scaled.blob, { orientation: true });
const { originalWidth: width, originalHeight: height } = data;
@ -56,7 +61,7 @@ describe('scaleImageToLevel', () => {
'Test setup failure: expected fixture to have EXIF data'
);
const scaled = await scaleImageToLevel(original, IMAGE_JPEG, true);
const scaled = await scaleImageToLevel(original, IMAGE_JPEG, original.size);
assert.isUndefined(
(await loadImage(scaled.blob, { meta: true, orientation: true })).exif
);