Update the test case `test23ThatThumbnailEncodeCalculation`

This commit is contained in:
DreamPiggy 2022-11-07 15:25:52 +08:00
parent 136d05fce8
commit 7c4649c7cc
1 changed files with 8 additions and 1 deletions

View File

@ -369,7 +369,14 @@
SDImageCoderEncodeMaxPixelSize: @(thumbnailSize)
}];
UIImage *encodedImage = [UIImage sd_imageWithData:encodedData];
expect(encodedImage.size).equal(CGSizeMake(4000, 2629));
// Encode keep aspect ratio, but will use scale down instead of scale up if we strip the image-io related info (to fix some Apple's bug)
// See more in `SDCGImageCreateCopy`
expect(image.sd_isDecoded).beFalsy();
if (@available(iOS 15, tvOS 15, *)) {
expect(encodedImage.size).equal(CGSizeMake(4000, 2628));
} else {
expect(encodedImage.size).equal(CGSizeMake(4000, 2629));
}
}
- (void)test24ThatScaleSizeCalculation {