Remove autoOrientJPEG and consolidate downscaling logic
This commit is contained in:
parent
3eed6cb350
commit
09b5e6ef50
10 changed files with 105 additions and 144 deletions
|
@ -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
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue