Skip to content

Commit

Permalink
新增needFixComposition属性,默认为NO,不再主动修正视频转向,防止部分安卓拍的视频导出失败,发布2.2.6版本
Browse files Browse the repository at this point in the history
  • Loading branch information
banchichen committed Aug 21, 2018
1 parent 8c70406 commit c8c2fe3
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 12 deletions.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

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

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

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

**Q:有的视频导出失败?**
A:升级到2.2.6及以上版本试试,发现是修正视频转向导致的,2.2.6开始默认不再主动修正。如需打开,可设置needFixComposition为YES,但有几率导致安卓拍的视频导出失败。

**Q:视频导出慢?**
A:视频导出分两步,第一步是通过PHAsset获取AVURLAsset,如是iCloud视频则涉及到网络请求,耗时容易不可控,第二步是通过AVURLAsset把视频保存到沙盒,耗时不算多。但第一步耗时不可控,你可以拷贝我源码出来拿到第一步的进度给用户一个进度提示...

## 六. Release Notes 最近更新

2.2.6 新增needFixComposition属性,默认为NO,不再主动修正视频转向,防止部分安卓拍的视频导出失败
2.2.5 修复minPhotoWidthSelectable不生效的问题, 使用@available消除警告
2.1.8 优化gif图播放的体验,加入iCloud同步进度条;新增notScaleImage属性,设置为YES时内部不去缩放图片
2.1.6 新增allowCameraLocation属性,默认为YES,置为NO时不会在照相/摄像时定位,修复一个序号紊乱的bug
Expand Down
4 changes: 2 additions & 2 deletions TZImagePickerController.podspec
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
Pod::Spec.new do |s|
s.name = "TZImagePickerController"
s.version = "2.2.5"
s.version = "2.2.6"
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" => "[email protected]" }
s.platform = :ios
s.ios.deployment_target = "6.0"
s.source = { :git => "https://github.com/banchichen/TZImagePickerController.git", :tag => "2.2.5" }
s.source = { :git => "https://github.com/banchichen/TZImagePickerController.git", :tag => "2.2.6" }
s.requires_arc = true
s.resources = "TZImagePickerController/TZImagePickerController/*.{png,bundle}"
s.source_files = "TZImagePickerController/TZImagePickerController/*.{h,m}"
Expand Down
2 changes: 1 addition & 1 deletion TZImagePickerController/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>2.2.5</string>
<string>2.2.6</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
12 changes: 7 additions & 5 deletions TZImagePickerController/TZImagePickerController/TZImageManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -888,12 +888,14 @@ - (void)startExportVideoWithVideoAsset:(AVURLAsset *)videoAsset presetName:(NSSt
[[NSFileManager defaultManager] createDirectoryAtPath:[NSHomeDirectory() stringByAppendingFormat:@"/tmp"] withIntermediateDirectories:YES attributes:nil error:nil];
}

AVMutableVideoComposition *videoComposition = [self fixedCompositionWithAsset:videoAsset];
if (videoComposition.renderSize.width) {
// 修正视频转向
session.videoComposition = videoComposition;
if ([TZImagePickerConfig sharedInstance].needFixComposition) {
AVMutableVideoComposition *videoComposition = [self fixedCompositionWithAsset:videoAsset];
if (videoComposition.renderSize.width) {
// 修正视频转向
session.videoComposition = videoComposition;
}
}

// Begin to export video to the output path asynchronously.
[session exportAsynchronouslyWithCompletionHandler:^(void) {
dispatch_async(dispatch_get_main_queue(), ^{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//
// Created by 谭真 on 15/12/24.
// Copyright © 2015年 谭真. All rights reserved.
// version 2.2.5 - 2018.08.10
// version 2.2.6 - 2018.08.21
// 更多信息,请前往项目的github地址:https://github.com/banchichen/TZImagePickerController

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

/// 默认是NO,如果设置为YES,导出视频时会修正转向(慎重设为YES,可能导致部分安卓下拍的视频导出失败)
@property (assign, nonatomic) BOOL needFixComposition;

/// The photos user have selected
/// 用户选中过的图片数组
@property (nonatomic, strong) NSMutableArray *selectedAssets;
Expand Down Expand Up @@ -332,4 +335,5 @@
@property (assign, nonatomic) BOOL showSelectedIndex;
@property (assign, nonatomic) BOOL showPhotoCannotSelectLayer;
@property (assign, nonatomic) BOOL notScaleImage;
@property (assign, nonatomic) BOOL needFixComposition;
@end
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//
// Created by 谭真 on 15/12/24.
// Copyright © 2015年 谭真. All rights reserved.
// version 2.2.5 - 2018.08.10
// version 2.2.6 - 2018.08.21
// 更多信息,请前往项目的github地址:https://github.com/banchichen/TZImagePickerController

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

- (void)setNeedFixComposition:(BOOL)needFixComposition {
_needFixComposition = needFixComposition;
[TZImagePickerConfig sharedInstance].needFixComposition = needFixComposition;
}

- (void)observeAuthrizationStatusChange {
[_timer invalidate];
_timer = nil;
Expand Down
2 changes: 1 addition & 1 deletion TZImagePickerControllerFramework/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>2.2.5</string>
<string>2.2.6</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
Expand Down

0 comments on commit c8c2fe3

Please sign in to comment.