|
@@ -16,7 +16,11 @@
|
|
|
#import <Accelerate/Accelerate.h>
|
|
|
#import <QuartzCore/QuartzCore.h>
|
|
|
#import <MobileCoreServices/MobileCoreServices.h>
|
|
|
-#import <AssetsLibrary/AssetsLibrary.h>
|
|
|
+
|
|
|
+#if !TARGET_OS_VISION
|
|
|
+//#import <AssetsLibrary/AssetsLibrary.h>
|
|
|
+#endif
|
|
|
+
|
|
|
#import <objc/runtime.h>
|
|
|
#import <pthread.h>
|
|
|
#import <zlib.h>
|
|
@@ -1542,7 +1546,11 @@ CGImageRef YYCGImageCreateWithWebPData(CFDataRef webpData,
|
|
|
}
|
|
|
|
|
|
- (instancetype)init {
|
|
|
+#if !TARGET_OS_VISION
|
|
|
return [self initWithScale:[UIScreen mainScreen].scale];
|
|
|
+#else
|
|
|
+ return [self initWithScale:1.f];
|
|
|
+#endif
|
|
|
}
|
|
|
|
|
|
- (instancetype)initWithScale:(CGFloat)scale {
|
|
@@ -2795,17 +2803,19 @@ CGImageRef YYCGImageCreateWithWebPData(CFDataRef webpData,
|
|
|
- (void)yy_saveToAlbumWithCompletionBlock:(void(^)(NSURL *assetURL, NSError *error))completionBlock {
|
|
|
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
|
|
NSData *data = [self _yy_dataRepresentationForSystem:YES];
|
|
|
- ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];
|
|
|
- [library writeImageDataToSavedPhotosAlbum:data metadata:nil completionBlock:^(NSURL *assetURL, NSError *error){
|
|
|
- if (!completionBlock) return;
|
|
|
- if (pthread_main_np()) {
|
|
|
- completionBlock(assetURL, error);
|
|
|
- } else {
|
|
|
- dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
- completionBlock(assetURL, error);
|
|
|
- });
|
|
|
- }
|
|
|
- }];
|
|
|
+//#if !TARGET_OS_VISION
|
|
|
+// ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];
|
|
|
+// [library writeImageDataToSavedPhotosAlbum:data metadata:nil completionBlock:^(NSURL *assetURL, NSError *error){
|
|
|
+// if (!completionBlock) return;
|
|
|
+// if (pthread_main_np()) {
|
|
|
+// completionBlock(assetURL, error);
|
|
|
+// } else {
|
|
|
+// dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
+// completionBlock(assetURL, error);
|
|
|
+// });
|
|
|
+// }
|
|
|
+// }];
|
|
|
+//#endif
|
|
|
});
|
|
|
}
|
|
|
|