Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the limitBytes options does not work as expected because of type error #110

Merged
merged 1 commit into from Apr 9, 2024

Conversation

JiaqiSun
Copy link
Contributor

@JiaqiSun JiaqiSun commented Apr 8, 2024

NSUInteger limitBytes = 0;
NSNumber *limitBytesValue = options[SDImageCoderDecodeScaleDownLimitBytes];
if (limitBytesValue != nil) {
limitBytes = limitBytesValue.unsignedIntegerValue;
}
_limitBytes = limitBytes; ❌❌❌ **ERROR: limitBytes = 62914560, but _limitBytes = 1。**❌❌❌
// Scale down to limit bytes if need
if (_limitBytes > 0) {
// Hack 32 BitsPerPixel
CGSize imageSize = CGSizeMake(_canvasWidth, _canvasHeight);
CGSize framePixelSize = SDCalculateScaleDownPixelSize(_limitBytes, imageSize, _frameCount, 4);
// Override thumbnail size
_thumbnailSize = framePixelSize;
_preserveAspectRatio = YES;
}

image

@dreampiggy dreampiggy merged commit fed1583 into SDWebImage:master Apr 9, 2024
@dreampiggy dreampiggy changed the title FIX: _limitBytes type error Fix the limitBytes options does not work as expected because of type error Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants