Skip to content

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.

2 participants