mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-05-03 20:46:28 +00:00
Do not save photos and videos taken from Linphone if auto save to gallery is off
This commit is contained in:
parent
8a86ce82f8
commit
9740a18219
2 changed files with 9 additions and 5 deletions
|
|
@ -988,9 +988,11 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
});
|
||||
}];
|
||||
|
||||
if (![info valueForKey:UIImagePickerControllerReferenceURL]) {
|
||||
BOOL saveToGallery = [ConfigManager.instance lpConfigBoolForKeyWithKey:@"auto_write_to_gallery_preference"];
|
||||
|
||||
if (![info valueForKey:UIImagePickerControllerReferenceURL] && saveToGallery) {
|
||||
[self writeVideoToGallery:mediaURL];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+ (void)writeMediaToGallery:(NSString *)name fileType:(NSString *)fileType {
|
||||
|
|
@ -1077,6 +1079,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
}
|
||||
|
||||
-(void) writeVideoToGallery:(NSURL *)url {
|
||||
|
||||
NSString *localIdentifier;
|
||||
PHFetchResult<PHAssetCollection *> *assetCollections = [PHAssetCollection fetchAssetCollectionsWithType:PHAssetCollectionTypeAlbum subtype:PHAssetCollectionSubtypeAlbumRegular options:nil];
|
||||
for (PHAssetCollection *assetCollection in assetCollections) {
|
||||
|
|
|
|||
|
|
@ -183,13 +183,13 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
PHFetchResult<PHAsset *> *phFetchResult = [PHAsset fetchAssetsWithALAssetURLs:@[alassetURL] options:nil];
|
||||
phasset = [phFetchResult firstObject];
|
||||
}
|
||||
|
||||
BOOL saveToGallery = [ConfigManager.instance lpConfigBoolForKeyWithKey:@"auto_write_to_gallery_preference"];
|
||||
UIImage *image = [info objectForKey:UIImagePickerControllerEditedImage] ? [info objectForKey:UIImagePickerControllerEditedImage] : [info objectForKey:UIImagePickerControllerOriginalImage];
|
||||
if (!phasset) {
|
||||
if (!phasset && saveToGallery) {
|
||||
[self writeImageToGallery:image];
|
||||
return;
|
||||
}
|
||||
[self passImageToDelegate:image PHAssetId:[phasset localIdentifier]];
|
||||
[self passImageToDelegate:image PHAssetId:saveToGallery ? [phasset localIdentifier] : nil];
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -197,6 +197,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
|
||||
|
||||
-(void) writeImageToGallery:(UIImage *)image {
|
||||
|
||||
NSString *localIdentifier;
|
||||
[SVProgressHUD show];
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue