Skip to content

Commit

Permalink
Release 4.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
longitachi committed Nov 25, 2020
1 parent 0b56ad3 commit 64db6f1
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE.MD
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Please fill in the detailed description of the issue (full output of any stack trace, compiler error, ...) and the steps to reproduce the issue.

#### Info
ZLPhotoBrowser version: e.g. 4.1.0
ZLPhotoBrowser version: e.g. 4.1.1
Device: e.g. iPhone X
Device version: e.g. iOS 14.0
Xcode version: e.g. Xcode 12.0
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ If you only want to use the image edit feature, please move to [ZLImageEditor](h
### <a id="UpdateLog"></a>Update Log
> [More logs](https://github.com/longitachi/ZLPhotoBrowser/blob/master/UPDATELOG.md)
```
● 4.1.1 - 4.1.0 Patch:
Fix:
Fix a crash when using zoom to preview local images and network images.
● 4.1.0:
Add:
Image editor add text sticker and image sticker feature.
Expand All @@ -106,8 +109,6 @@ If you only want to use the image edit feature, please move to [ZLImageEditor](h
Provides the ability to preview PHAsset, local images and videos, network images and videos together.
Optimize some UI effects.
Support show image crop vc directly.
● 4.0.8:
Add filter to image editor.
...
```

Expand Down
5 changes: 3 additions & 2 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@
### <a id="更新日志"></a>更新日志
> [更多更新日志](https://github.com/longitachi/ZLPhotoBrowser/blob/master/UPDATELOG.md)
```
● 4.1.1 - 4.1.0 Patch:
Fix:
修复了预览本地和网络图片时,缩放后滑动会闪退的bug:
● 4.1.0:
新增:
编辑图片工具新增文本贴纸和图片贴纸;
Expand All @@ -113,8 +116,6 @@
完善iOS14 limited authority 权限的适配;
提供可以同时预览PHAsset、本地图片/视频及网络图片/视频的功能; 优化部分UI效果;
编辑图片可直接跳转裁剪界面;
● 4.0.8:
编辑图片添加滤镜功能;
...
```

Expand Down
10 changes: 7 additions & 3 deletions Sources/Edit/ZLClipImageViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ class ZLClipImageViewController: UIViewController {

static let clipRatioItemSize: CGSize = CGSize(width: 60, height: 70)

var animate = true

/// 用作进入裁剪界面首次动画frame
var presentAnimateFrame: CGRect?

Expand Down Expand Up @@ -194,7 +196,9 @@ class ZLClipImageViewController: UIViewController {
super.viewDidAppear(animated)

self.viewDidAppearCount += 1
self.transitioningDelegate = self
if self.presentingViewController is ZLEditImageViewController {
self.transitioningDelegate = self
}

guard self.viewDidAppearCount == 1 else {
return
Expand Down Expand Up @@ -496,7 +500,7 @@ class ZLClipImageViewController: UIViewController {
self.dismissAnimateFromRect = self.cancelClipAnimateFrame
self.dismissAnimateImage = self.presentAnimateImage
self.cancelClipBlock?()
self.dismiss(animated: true, completion: nil)
self.dismiss(animated: self.animate, completion: nil)
}

@objc func revertBtnClick() {
Expand All @@ -515,7 +519,7 @@ class ZLClipImageViewController: UIViewController {
self.dismissAnimateFromRect = self.clipBoxFrame
self.dismissAnimateImage = image.clipImage
self.clipDoneBlock?(self.angle, image.editRect, self.selectedRatio)
self.dismiss(animated: true, completion: nil)
self.dismiss(animated: self.animate, completion: nil)
}

@objc func rotateBtnClick() {
Expand Down
14 changes: 9 additions & 5 deletions Sources/Edit/ZLEditImageViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ public class ZLEditImageViewController: UIViewController {

static let ashbinNormalBgColor = zlRGB(40, 40, 40).withAlphaComponent(0.8)

var animate = false

var originalImage: UIImage

// 第一次进入界面时,布局后frame,裁剪dimiss动画使用
Expand Down Expand Up @@ -183,23 +185,25 @@ public class ZLEditImageViewController: UIViewController {
zl_debugPrint("ZLEditImageViewController deinit")
}

@objc public class func showEditImageVC(parentVC: UIViewController?, image: UIImage, editModel: ZLEditImageModel? = nil, completion: ( (UIImage, ZLEditImageModel) -> Void )? ) {
@objc public class func showEditImageVC(parentVC: UIViewController?, animate: Bool = false, image: UIImage, editModel: ZLEditImageModel? = nil, completion: ( (UIImage, ZLEditImageModel) -> Void )? ) {
let tools = ZLPhotoConfiguration.default().editImageTools
if ZLPhotoConfiguration.default().showClipDirectlyIfOnlyHasClipTool, tools.count == 1, tools.contains(.clip) {
let vc = ZLClipImageViewController(image: image, editRect: editModel?.editRect, angle: editModel?.angle ?? 0, selectRatio: editModel?.selectRatio)
vc.clipDoneBlock = { (angle, editRect, ratio) in
let m = ZLEditImageModel(drawPaths: [], mosaicPaths: [], editRect: editRect, angle: angle, selectRatio: ratio, selectFilter: .normal, textStickers: nil, imageStickers: nil)
completion?(image.clipImage(angle, editRect) ?? image, m)
}
vc.animate = animate
vc.modalPresentationStyle = .fullScreen
parentVC?.present(vc, animated: false, completion: nil)
parentVC?.present(vc, animated: animate, completion: nil)
} else {
let vc = ZLEditImageViewController(image: image, editModel: editModel)
vc.editFinishBlock = { (ei, editImageModel) in
completion?(ei, editImageModel)
}
vc.animate = animate
vc.modalPresentationStyle = .fullScreen
parentVC?.present(vc, animated: false, completion: nil)
parentVC?.present(vc, animated: animate, completion: nil)
}
}

Expand Down Expand Up @@ -569,7 +573,7 @@ public class ZLEditImageViewController: UIViewController {
}

@objc func cancelBtnClick() {
self.dismiss(animated: false, completion: nil)
self.dismiss(animated: self.animate, completion: nil)
}

func drawBtnClick() {
Expand Down Expand Up @@ -671,7 +675,7 @@ public class ZLEditImageViewController: UIViewController {
var image = self.buildImage()
image = image.clipImage(self.angle, self.editRect) ?? image
self.editFinishBlock?(image, ZLEditImageModel(drawPaths: self.drawPaths, mosaicPaths: self.mosaicPaths, editRect: self.editRect, angle: self.angle, selectRatio: self.selectRatio, selectFilter: self.currentFilter, textStickers: textStickers, imageStickers: imageStickers))
self.dismiss(animated: false, completion: nil)
self.dismiss(animated: self.animate, completion: nil)
}

@objc func revokeBtnClick() {
Expand Down
2 changes: 1 addition & 1 deletion Sources/General/ZLPhotoBrowser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

let version = "4.1.0"
let version = "4.1.1"
7 changes: 7 additions & 0 deletions UPDATELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

-----

## [4.1.1](https://github.com/longitachi/ZLPhotoBrowser/releases/tag/4.1.1) (2020-11-25)

### Fix
* Fix a crash when using zoom to preview local images and network images.[#556](https://github.com/longitachi/ZLPhotoBrowser/issues/556)

---

## [4.1.0](https://github.com/longitachi/ZLPhotoBrowser/releases/tag/4.1.0) (2020-11-21)

### Add
Expand Down
2 changes: 1 addition & 1 deletion ZLPhotoBrowser.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'ZLPhotoBrowser'
s.version = '4.1.0'
s.version = '4.1.1'
s.summary = 'A lightweight and pure Swift implemented library for select photos from album'

s.description = <<-DESC
Expand Down

0 comments on commit 64db6f1

Please sign in to comment.