Remove autoOrientJPEG and consolidate downscaling logic

This commit is contained in:
trevor-signal 2024-03-06 16:49:21 -05:00 committed by GitHub
parent 3eed6cb350
commit 09b5e6ef50
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 105 additions and 144 deletions

View file

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