Skip to content

Commit

Permalink
优化获取GIF图的一些细节;发布2.1.8版本
Browse files Browse the repository at this point in the history
  • Loading branch information
banchichen committed Jul 5, 2018
1 parent ce534e1 commit 14670c4
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 26 deletions.
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -8,7 +8,7 @@

## 重要提示1:提issue前请先搜索,先从已有issue里找找线索。如果发现bug,请先和Demo对照自查下,如果Demo也有bug,请再提issue。Demo正常你那不正常的,提issue时请贴上你的初始化代码,注明必要的复现步骤。这样能避免多余的沟通,帮助你更快获取答案。

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

关于升级iOS10和Xcdoe8的提示:
在Xcode8环境下将项目运行在iOS10的设备/模拟器中,访问相册和相机需要额外配置info.plist文件。分别是Privacy - Photo Library Usage Description和Privacy - Camera Usage Description字段,详见Demo中info.plist中的设置。
Expand Down Expand Up @@ -97,7 +97,7 @@ A:1.8.4版本已支持
A:考虑下,优先级低

最近更新
2.1.7 优化gif图播放的体验,加入iCloud同步进度条;新增notScaleImage属性,设置为YES时内部不去缩放图片
2.1.8 优化gif图播放的体验,加入iCloud同步进度条;新增notScaleImage属性,设置为YES时内部不去缩放图片
2.1.6 新增allowCameraLocation属性,默认为YES,置为NO时不会在照相/摄像时定位,修复一个序号紊乱的bug
2.1.5 修复开启showSelectedIndex后照片列表页iCloud图片进度条紊乱的bug
2.1.4 新增多个页面和组件的样式自定义block,允许自定义绝大多数UI样式
Expand Down
4 changes: 2 additions & 2 deletions TZImagePickerController.podspec
@@ -1,13 +1,13 @@
Pod::Spec.new do |s|
s.name = "TZImagePickerController"
s.version = "2.1.7"
s.version = "2.1.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 => "2.1.7" }
s.source = { :git => "https://github.com/banchichen/TZImagePickerController.git", :tag => "2.1.8" }
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
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>2.1.7</string>
<string>2.1.8</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
Expand Up @@ -4,7 +4,7 @@
//
// Created by 谭真 on 15/12/24.
// Copyright © 2015年 谭真. All rights reserved.
// version 2.1.7 - 2018.07.05
// version 2.1.8 - 2018.07.05
// 更多信息,请前往项目的github地址:https://github.com/banchichen/TZImagePickerController

/*
Expand Down
Expand Up @@ -4,7 +4,7 @@
//
// Created by 谭真 on 15/12/24.
// Copyright © 2015年 谭真. All rights reserved.
// version 2.1.7 - 2018.07.05
// version 2.1.8 - 2018.07.05
// 更多信息,请前往项目的github地址:https://github.com/banchichen/TZImagePickerController

#import "TZImagePickerController.h"
Expand Down
Expand Up @@ -92,7 +92,7 @@ - (void)layoutSubviews {


@interface TZPhotoPreviewView ()<UIScrollViewDelegate>

@property (assign, nonatomic) BOOL isRequestingGIF;
@end

@implementation TZPhotoPreviewView
Expand Down Expand Up @@ -149,32 +149,39 @@ - (void)configProgressView {

- (void)setModel:(TZAssetModel *)model {
_model = model;
self.isRequestingGIF = NO;
[_scrollView setZoomScale:1.0 animated:NO];
if (model.type == TZAssetModelMediaTypePhotoGif) {
// 先显示缩略图
[[TZImageManager manager] getPhotoWithAsset:model.asset completion:^(UIImage *photo, NSDictionary *info, BOOL isDegraded) {
self.imageView.image = photo;
[self resizeSubviews];
if (self.isRequestingGIF) {
return;
}
// 再显示gif动图
if (!isDegraded) {
[[TZImageManager manager] getOriginalPhotoDataWithAsset:model.asset progressHandler:^(double progress, NSError *error, BOOL *stop, NSDictionary *info) {
progress = progress > 0.02 ? progress : 0.02;
dispatch_async(dispatch_get_main_queue(), ^{
self.progressView.progress = progress;
if (progress >= 1) {
self.progressView.hidden = YES;
} else {
self.progressView.hidden = NO;
}
});
} completion:^(NSData *data, NSDictionary *info, BOOL isDegraded) {
if (!isDegraded) {
self.isRequestingGIF = YES;
[[TZImageManager manager] getOriginalPhotoDataWithAsset:model.asset progressHandler:^(double progress, NSError *error, BOOL *stop, NSDictionary *info) {
progress = progress > 0.02 ? progress : 0.02;
dispatch_async(dispatch_get_main_queue(), ^{
self.progressView.progress = progress;
if (progress >= 1) {
self.progressView.hidden = YES;
self.imageView.image = [UIImage sd_tz_animatedGIFWithData:data];
[self resizeSubviews];
} else {
self.progressView.hidden = NO;
}
}];
}
});
#ifdef DEBUG
NSLog(@"[TZImagePickerController] getOriginalPhotoDataWithAsset:%f error:%@", progress, error);
#endif
} completion:^(NSData *data, NSDictionary *info, BOOL isDegraded) {
if (!isDegraded) {
self.isRequestingGIF = NO;
self.progressView.hidden = YES;
self.imageView.image = [UIImage sd_tz_animatedGIFWithData:data];
[self resizeSubviews];
}
}];
} progressHandler:nil networkAccessAllowed:NO];
} else {
self.asset = model.asset;
Expand Down
2 changes: 1 addition & 1 deletion TZImagePickerControllerFramework/Info.plist
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>2.1.7</string>
<string>2.1.8</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
Expand Down

0 comments on commit 14670c4

Please sign in to comment.