Skip to content

Commit c8c2fe3

Browse files
committed
新增needFixComposition属性,默认为NO,不再主动修正视频转向,防止部分安卓拍的视频导出失败,发布2.2.6版本
1 parent 8c70406 commit c8c2fe3

File tree

7 files changed

+31
-12
lines changed

7 files changed

+31
-12
lines changed

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
## 重要提示2:issue未说明下面必要情况的不予处理:1、我的demo是否正常? 2、你用的什么版本? 3、你的初始化TZImagePicker的代码 4、你是pod安装还是源码导入的?是否有改动TZImagePicker内部代码?
1212

13-
## 重要提示3:1.9.0版本后移除了"prefs:root="的调用,这个API已经被列为私有API,请大家尽快升级。目前最新版本2.2.5
13+
## 重要提示3:1.9.0版本后移除了"prefs:root="的调用,这个API已经被列为私有API,请大家尽快升级。目前最新版本2.2.6
1414

1515
关于升级iOS10和Xcdoe8的提示:
1616
在Xcode8环境下将项目运行在iOS10的设备/模拟器中,访问相册和相机需要额外配置info.plist文件。分别是Privacy - Photo Library Usage Description和Privacy - Camera Usage Description字段,详见Demo中info.plist中的设置。
@@ -112,8 +112,15 @@ A:是否有集成WRNavigationBar?如有,参考其readme调一下它的wr_s
112112
**Q:导航栏没了?**
113113
A:是否有集成GKNavigationBarViewController?需要升级到2.0.4及以上版本,详见issue:[https://github.com/QuintGao/GKNavigationBarViewController/issues/7](https://github.com/QuintGao/GKNavigationBarViewController/issues/7)
114114

115+
**Q:有的视频导出失败?**
116+
A:升级到2.2.6及以上版本试试,发现是修正视频转向导致的,2.2.6开始默认不再主动修正。如需打开,可设置needFixComposition为YES,但有几率导致安卓拍的视频导出失败。
117+
118+
**Q:视频导出慢?**
119+
A:视频导出分两步,第一步是通过PHAsset获取AVURLAsset,如是iCloud视频则涉及到网络请求,耗时容易不可控,第二步是通过AVURLAsset把视频保存到沙盒,耗时不算多。但第一步耗时不可控,你可以拷贝我源码出来拿到第一步的进度给用户一个进度提示...
120+
115121
## 六. Release Notes 最近更新
116122

123+
2.2.6 新增needFixComposition属性,默认为NO,不再主动修正视频转向,防止部分安卓拍的视频导出失败
117124
2.2.5 修复minPhotoWidthSelectable不生效的问题, 使用@available消除警告
118125
2.1.8 优化gif图播放的体验,加入iCloud同步进度条;新增notScaleImage属性,设置为YES时内部不去缩放图片
119126
2.1.6 新增allowCameraLocation属性,默认为YES,置为NO时不会在照相/摄像时定位,修复一个序号紊乱的bug

TZImagePickerController.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
Pod::Spec.new do |s|
22
s.name = "TZImagePickerController"
3-
s.version = "2.2.5"
3+
s.version = "2.2.6"
44
s.summary = "A clone of UIImagePickerController, support picking multiple photos、original photo and video"
55
s.homepage = "https://github.com/banchichen/TZImagePickerController"
66
s.license = "MIT"
77
s.author = { "banchichen" => "tanzhenios@foxmail.com" }
88
s.platform = :ios
99
s.ios.deployment_target = "6.0"
10-
s.source = { :git => "https://github.com/banchichen/TZImagePickerController.git", :tag => "2.2.5" }
10+
s.source = { :git => "https://github.com/banchichen/TZImagePickerController.git", :tag => "2.2.6" }
1111
s.requires_arc = true
1212
s.resources = "TZImagePickerController/TZImagePickerController/*.{png,bundle}"
1313
s.source_files = "TZImagePickerController/TZImagePickerController/*.{h,m}"

TZImagePickerController/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<key>CFBundlePackageType</key>
1616
<string>APPL</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>2.2.5</string>
18+
<string>2.2.6</string>
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleVersion</key>

TZImagePickerController/TZImagePickerController/TZImageManager.m

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -888,12 +888,14 @@ - (void)startExportVideoWithVideoAsset:(AVURLAsset *)videoAsset presetName:(NSSt
888888
[[NSFileManager defaultManager] createDirectoryAtPath:[NSHomeDirectory() stringByAppendingFormat:@"/tmp"] withIntermediateDirectories:YES attributes:nil error:nil];
889889
}
890890

891-
AVMutableVideoComposition *videoComposition = [self fixedCompositionWithAsset:videoAsset];
892-
if (videoComposition.renderSize.width) {
893-
// 修正视频转向
894-
session.videoComposition = videoComposition;
891+
if ([TZImagePickerConfig sharedInstance].needFixComposition) {
892+
AVMutableVideoComposition *videoComposition = [self fixedCompositionWithAsset:videoAsset];
893+
if (videoComposition.renderSize.width) {
894+
// 修正视频转向
895+
session.videoComposition = videoComposition;
896+
}
895897
}
896-
898+
897899
// Begin to export video to the output path asynchronously.
898900
[session exportAsynchronouslyWithCompletionHandler:^(void) {
899901
dispatch_async(dispatch_get_main_queue(), ^{

TZImagePickerController/TZImagePickerController/TZImagePickerController.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//
55
// Created by 谭真 on 15/12/24.
66
// Copyright © 2015年 谭真. All rights reserved.
7-
// version 2.2.5 - 2018.08.10
7+
// version 2.2.6 - 2018.08.21
88
// 更多信息,请前往项目的github地址:https://github.com/banchichen/TZImagePickerController
99

1010
/*
@@ -133,6 +133,9 @@
133133
/// 默认是NO,如果设置为YES,内部不会缩放图片到photoWidth像素宽
134134
@property (assign, nonatomic) BOOL notScaleImage;
135135

136+
/// 默认是NO,如果设置为YES,导出视频时会修正转向(慎重设为YES,可能导致部分安卓下拍的视频导出失败)
137+
@property (assign, nonatomic) BOOL needFixComposition;
138+
136139
/// The photos user have selected
137140
/// 用户选中过的图片数组
138141
@property (nonatomic, strong) NSMutableArray *selectedAssets;
@@ -332,4 +335,5 @@
332335
@property (assign, nonatomic) BOOL showSelectedIndex;
333336
@property (assign, nonatomic) BOOL showPhotoCannotSelectLayer;
334337
@property (assign, nonatomic) BOOL notScaleImage;
338+
@property (assign, nonatomic) BOOL needFixComposition;
335339
@end

TZImagePickerController/TZImagePickerController/TZImagePickerController.m

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//
55
// Created by 谭真 on 15/12/24.
66
// Copyright © 2015年 谭真. All rights reserved.
7-
// version 2.2.5 - 2018.08.10
7+
// version 2.2.6 - 2018.08.21
88
// 更多信息,请前往项目的github地址:https://github.com/banchichen/TZImagePickerController
99

1010
#import "TZImagePickerController.h"
@@ -273,6 +273,7 @@ - (void)configDefaultSetting {
273273
self.allowPreview = YES;
274274
// 2.2.26版本,不主动缩放图片,降低内存占用
275275
self.notScaleImage = YES;
276+
self.needFixComposition = NO;
276277
self.statusBarStyle = UIStatusBarStyleLightContent;
277278
self.cannotSelectLayerColor = [[UIColor whiteColor] colorWithAlphaComponent:0.8];
278279
self.allowCameraLocation = YES;
@@ -361,6 +362,11 @@ - (void)setNotScaleImage:(BOOL)notScaleImage {
361362
[TZImagePickerConfig sharedInstance].notScaleImage = notScaleImage;
362363
}
363364

365+
- (void)setNeedFixComposition:(BOOL)needFixComposition {
366+
_needFixComposition = needFixComposition;
367+
[TZImagePickerConfig sharedInstance].needFixComposition = needFixComposition;
368+
}
369+
364370
- (void)observeAuthrizationStatusChange {
365371
[_timer invalidate];
366372
_timer = nil;

TZImagePickerControllerFramework/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<key>CFBundlePackageType</key>
1616
<string>FMWK</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>2.2.5</string>
18+
<string>2.2.6</string>
1919
<key>CFBundleVersion</key>
2020
<string>$(CURRENT_PROJECT_VERSION)</string>
2121
<key>NSPrincipalClass</key>

0 commit comments

Comments
 (0)