Commit e2e0880b authored by banchichen's avatar banchichen

1.7.8 修复导出视频时的崩溃问题

parent 34c192f9
Pod::Spec.new do |s|
s.name = "TZImagePickerController"
s.version = "1.7.7"
s.version = "1.7.8"
s.summary = "A clone of UIImagePickerController, support picking multiple photos、original photo and video"
s.homepage = "https://github.com/banchichen/TZImagePickerController"
s.license = "MIT"
s.author = { "banchichen" => "tanzhenios@foxmail.com" }
s.platform = :ios
s.ios.deployment_target = "6.0"
s.source = { :git => "https://github.com/banchichen/TZImagePickerController.git", :tag => "1.7.7" }
s.source = { :git => "https://github.com/banchichen/TZImagePickerController.git", :tag => "1.7.8" }
s.requires_arc = true
s.resources = "TZImagePickerController/TZImagePickerController/*.{png,xib,nib,bundle}"
s.source_files = "TZImagePickerController/TZImagePickerController/*.{h,m}"
......
......@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.7.7</string>
<string>1.7.8</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
......
......@@ -9,6 +9,7 @@
#import "TZImageCropManager.h"
#import "UIView+Layout.h"
#import <ImageIO/ImageIO.h>
#import "TZImageManager.h"
@implementation TZImageCropManager
......@@ -48,6 +49,7 @@
cropSize:rect.size
imageViewSize:imageView.frame.size];
UIImage *cropedImage = [UIImage imageWithCGImage:imageRef];
cropedImage = [[TZImageManager manager] fixOrientation:cropedImage];
CGImageRelease(imageRef);
return cropedImage;
}
......
......@@ -85,6 +85,9 @@
- (BOOL)isPhotoSelectableWithAsset:(id)asset;
- (CGSize)photoSizeWithAsset:(id)asset;
/// 修正图片转向
- (UIImage *)fixOrientation:(UIImage *)aImage;
@end
......
......@@ -262,6 +262,7 @@ static CGFloat TZScreenScale;
}
if (!allowPickingVideo && type == TZAssetModelMediaTypeVideo) return nil;
if (!allowPickingImage && type == TZAssetModelMediaTypePhoto) return nil;
if (!allowPickingImage && type == TZAssetModelMediaTypePhotoGif) return nil;
if (self.hideWhenCanNotSelect) {
// 过滤掉尺寸不满足要求的图片
......@@ -634,8 +635,11 @@ static CGFloat TZScreenScale;
[[NSFileManager defaultManager] createDirectoryAtPath:[NSHomeDirectory() stringByAppendingFormat:@"/tmp"] withIntermediateDirectories:YES attributes:nil error:nil];
}
// 修正视频转向
session.videoComposition = [self fixedCompositionWithAsset:videoAsset];
AVMutableVideoComposition *videoComposition = [self fixedCompositionWithAsset:videoAsset];
if (videoComposition.renderSize.width) {
// 修正视频转向
session.videoComposition = videoComposition;
}
// Begin to export video to the output path asynchronously.
[session exportAsynchronouslyWithCompletionHandler:^(void) {
......
......@@ -4,7 +4,7 @@
//
// Created by 谭真 on 15/12/24.
// Copyright © 2015年 谭真. All rights reserved.
// version 1.7.7 - 2016.12.13
// version 1.7.8 - 2016.12.20
/*
经过测试,比起xib的方式,把TZAssetCell改用纯代码的方式来写,滑动帧数明显提高了(约提高10帧左右)
......
......@@ -4,7 +4,7 @@
//
// Created by 谭真 on 15/12/24.
// Copyright © 2015年 谭真. All rights reserved.
// version 1.7.7 - 2016.12.13
// version 1.7.8 - 2016.12.20
#import "TZImagePickerController.h"
#import "TZPhotoPickerController.h"
......@@ -501,6 +501,11 @@
} else {
[self configTableView];
}
if (imagePickerVc.allowTakePicture) {
self.navigationItem.title = [NSBundle tz_localizedStringForKey:@"Photos"];
} else if (imagePickerVc.allowPickingVideo) {
self.navigationItem.title = [NSBundle tz_localizedStringForKey:@"Videos"];
}
}
- (void)configTableView {
......
......@@ -41,6 +41,7 @@
- (void)viewDidLoad {
[super viewDidLoad];
[TZImageManager manager].shouldFixOrientation = YES;
__weak typeof(self) weakSelf = self;
TZImagePickerController *_tzImagePickerVc = (TZImagePickerController *)weakSelf.navigationController;
if (!self.models.count) {
......@@ -72,6 +73,7 @@
[super viewWillDisappear:animated];
[self.navigationController setNavigationBarHidden:NO];
if (iOS7Later) [UIApplication sharedApplication].statusBarHidden = NO;
[TZImageManager manager].shouldFixOrientation = NO;
}
- (BOOL)prefersStatusBarHidden {
......
......@@ -466,11 +466,14 @@
[_allowPickingOriginalPhotoSwitch setOn:NO animated:YES];
[_showTakePhotoBtnSwitch setOn:NO animated:YES];
[_allowPickingVideoSwitch setOn:YES animated:YES];
[_allowPickingGifSwitch setOn:NO animated:YES];
}
}
- (IBAction)allowPickingGifSwitchClick:(UISwitch *)sender {
if (sender.isOn) {
[_allowPickingImageSwitch setOn:YES animated:YES];
}
}
- (IBAction)allowPickingVideoSwitchClick:(UISwitch *)sender {
......
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