|
@@ -544,7 +544,11 @@ static void URLInBlackListAdd(NSURL *url) {
|
|
|
if (now - _lastProgressiveDecodeTimestamp < min) return;
|
|
|
|
|
|
if (!_progressiveDecoder) {
|
|
|
+#if TARGET_OS_VISION
|
|
|
+ _progressiveDecoder = [[YYImageDecoder alloc] initWithScale:1.f];
|
|
|
+#else
|
|
|
_progressiveDecoder = [[YYImageDecoder alloc] initWithScale:[UIScreen mainScreen].scale];
|
|
|
+#endif
|
|
|
}
|
|
|
[_progressiveDecoder updateData:_data final:NO];
|
|
|
if ([self isCancelled]) return;
|
|
@@ -656,13 +660,21 @@ static void URLInBlackListAdd(NSURL *url) {
|
|
|
UIImage *image;
|
|
|
BOOL hasAnimation = NO;
|
|
|
if (allowAnimation) {
|
|
|
+#if TARGET_OS_VISION
|
|
|
+ image = [[YYImage alloc] initWithData:self.data scale:1.f];
|
|
|
+#else
|
|
|
image = [[YYImage alloc] initWithData:self.data scale:[UIScreen mainScreen].scale];
|
|
|
+#endif
|
|
|
if (shouldDecode) image = [image yy_imageByDecoded];
|
|
|
if ([((YYImage *)image) animatedImageFrameCount] > 1) {
|
|
|
hasAnimation = YES;
|
|
|
}
|
|
|
} else {
|
|
|
+#if TARGET_OS_VISION
|
|
|
+ YYImageDecoder *decoder = [YYImageDecoder decoderWithData:self.data scale:1.f];
|
|
|
+#else
|
|
|
YYImageDecoder *decoder = [YYImageDecoder decoderWithData:self.data scale:[UIScreen mainScreen].scale];
|
|
|
+#endif
|
|
|
image = [decoder frameAtIndex:0 decodeForDisplay:shouldDecode].image;
|
|
|
}
|
|
|
|