Commit 1a19ea78 authored by 林生雨's avatar 林生雨

commit

parent c78ddd69
This diff is collapsed.
...@@ -223,6 +223,11 @@ class AlbumModel { ...@@ -223,6 +223,11 @@ class AlbumModel {
} else { } else {
iosAlbum(_selectList, context, (value) { iosAlbum(_selectList, context, (value) {
print(value); print(value);
// iosAlbum(_selectList, context, (image) {
// iosAlbum(_selectList, context, (video) {
// print("IM $image VIDEI ${video}");
// });
// });
Navigator.pop(context, List<String>.from(value)[0]); Navigator.pop(context, List<String>.from(value)[0]);
}); });
} }
......
...@@ -230,6 +230,12 @@ NSString *cacheDirectory; ...@@ -230,6 +230,12 @@ NSString *cacheDirectory;
if(path!=nil){ if(path!=nil){
dispatch_async(queue, ^{ dispatch_async(queue, ^{
[self.channelList removeAllObjects]; [self.channelList removeAllObjects];
if(path.count==0){
dispatch_async(dispatch_get_main_queue(), ^{
[[ResultManager sharedSingleton] resultSuccess:[NSNumber numberWithLong:resultTemp] :self.channelList];
});
return ;
}
self.channelSize=0; self.channelSize=0;
self.channelAllSize=path.count; self.channelAllSize=path.count;
PHVideoRequestOptions *options = [[PHVideoRequestOptions alloc] init]; PHVideoRequestOptions *options = [[PHVideoRequestOptions alloc] init];
...@@ -261,7 +267,6 @@ NSString *cacheDirectory; ...@@ -261,7 +267,6 @@ NSString *cacheDirectory;
}]; }];
}else{ }else{
if([fileManager fileExistsAtPath:tempTake]){ if([fileManager fileExistsAtPath:tempTake]){
NSLog(@"1111");
self.channelSize++; self.channelSize++;
[self.channelList addObject:[NSString stringWithFormat:@"%@",tempTake]]; [self.channelList addObject:[NSString stringWithFormat:@"%@",tempTake]];
if(self.channelSize==self.channelAllSize){ if(self.channelSize==self.channelAllSize){
...@@ -270,7 +275,6 @@ NSString *cacheDirectory; ...@@ -270,7 +275,6 @@ NSString *cacheDirectory;
}); });
} }
}else{ }else{
NSLog(@"222");
int picWidth=[assets pixelWidth]; int picWidth=[assets pixelWidth];
int picHeight=[assets pixelHeight]; int picHeight=[assets pixelHeight];
float tempScareSize=1; float tempScareSize=1;
...@@ -282,13 +286,12 @@ NSString *cacheDirectory; ...@@ -282,13 +286,12 @@ NSString *cacheDirectory;
CGSize temp=CGSizeMake(picWidth*tempScareSize, picHeight*tempScareSize); CGSize temp=CGSizeMake(picWidth*tempScareSize, picHeight*tempScareSize);
[[PHImageManager defaultManager] requestImageForAsset:assets targetSize:temp contentMode:PHImageContentModeDefault options:imageRequestOption resultHandler:^(UIImage * _Nullable res, NSDictionary * _Nullable info) { [[PHImageManager defaultManager] requestImageForAsset:assets targetSize:temp contentMode:PHImageContentModeDefault options:imageRequestOption resultHandler:^(UIImage * _Nullable res, NSDictionary * _Nullable info) {
// @autoreleasepool{ @autoreleasepool{
NSLog(@"33333");
NSData *data = UIImageJPEGRepresentation(res, 0.8) ; NSData *data = UIImageJPEGRepresentation(res, 0.8) ;
[data writeToFile:tempTake atomically:YES]; [data writeToFile:tempTake atomically:YES];
data=nil; data=nil;
res=nil; res=nil;
// } }
self.channelSize++; self.channelSize++;
[self.channelList addObject:[NSString stringWithFormat:@"%@",tempTake]]; [self.channelList addObject:[NSString stringWithFormat:@"%@",tempTake]];
if(self.channelSize==self.channelAllSize){ if(self.channelSize==self.channelAllSize){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment