Commit e2e0880b authored by banchichen's avatar banchichen

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

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