Commit 805b8d8c authored by yuzheng's avatar yuzheng

修复PHAuthorizationStatusLimited权限下的列表页图片不显示和拍照crash问题

parent e7ebc84b
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
// Set the cell's thumbnail image if it's still showing the same asset. // Set the cell's thumbnail image if it's still showing the same asset.
if ([self.representedAssetIdentifier isEqualToString:model.asset.localIdentifier]) { if ([self.representedAssetIdentifier isEqualToString:model.asset.localIdentifier]) {
self.imageView.image = photo; self.imageView.image = photo;
[self setNeedsLayout];
} else { } else {
// NSLog(@"this cell is showing other asset"); // NSLog(@"this cell is showing other asset");
[[PHImageManager defaultManager] cancelImageRequest:self.imageRequestID]; [[PHImageManager defaultManager] cancelImageRequest:self.imageRequestID];
...@@ -360,8 +361,8 @@ ...@@ -360,8 +361,8 @@
_selectImageView.contentMode = UIViewContentModeScaleAspectFit; _selectImageView.contentMode = UIViewContentModeScaleAspectFit;
} }
_indexLabel.frame = _selectImageView.frame; _indexLabel.frame = _selectImageView.frame;
_imageView.frame = CGRectMake(0, 0, self.tz_width, self.tz_height); _imageView.frame = self.bounds;
static CGFloat progressWH = 20; static CGFloat progressWH = 20;
CGFloat progressXY = (self.tz_width - progressWH) / 2; CGFloat progressXY = (self.tz_width - progressWH) / 2;
_progressView.frame = CGRectMake(progressXY, progressXY, progressWH, progressWH); _progressView.frame = CGRectMake(progressXY, progressXY, progressWH, progressWH);
...@@ -413,6 +414,7 @@ ...@@ -413,6 +414,7 @@
self.titleLabel.attributedText = nameString; self.titleLabel.attributedText = nameString;
[[TZImageManager manager] getPostImageWithAlbumModel:model completion:^(UIImage *postImage) { [[TZImageManager manager] getPostImageWithAlbumModel:model completion:^(UIImage *postImage) {
self.posterImageView.image = postImage; self.posterImageView.image = postImage;
[self setNeedsLayout];
}]; }];
if (model.selectedCount) { if (model.selectedCount) {
self.selectedCountButton.hidden = NO; self.selectedCountButton.hidden = NO;
......
...@@ -826,8 +826,11 @@ static CGFloat itemMargin = 5; ...@@ -826,8 +826,11 @@ static CGFloat itemMargin = 5;
NSDictionary *meta = [info objectForKey:UIImagePickerControllerMediaMetadata]; NSDictionary *meta = [info objectForKey:UIImagePickerControllerMediaMetadata];
if (photo) { if (photo) {
[[TZImageManager manager] savePhotoWithImage:photo meta:meta location:self.location completion:^(PHAsset *asset, NSError *error){ [[TZImageManager manager] savePhotoWithImage:photo meta:meta location:self.location completion:^(PHAsset *asset, NSError *error){
if (!error) { if (!error && asset) {
[self addPHAsset:asset]; [self addPHAsset:asset];
} else {
TZImagePickerController *tzImagePickerVc = (TZImagePickerController *)self.navigationController;
[tzImagePickerVc hideProgressHUD];
} }
}]; }];
self.location = nil; self.location = nil;
......
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