longitachi / ZLPhotoBrowser

Wechat-like image picker. Support select photos, videos, gif and livePhoto. Support edit image and crop video. 微信样式的图片选择器,支持预览/相册内拍照及录视频、拖拽/滑动选择,编辑图片/视频,支持多语言国际化等功能;
MIT License
4.72k stars 953 forks source link

请问如何强制裁剪 #805

Closed xqd93 closed 1 year ago

xqd93 commented 1 year ago

Issue Description

比如选择头像,像微信选择头像那样,要求是正方形,可是设置editAfterSelectThumbnailImage为true也不能强制裁剪,用户依然可以选择未裁剪的图像

Info

ZLPhotoBrowser version: e.g. 4.3.9 Device: e.g. iPhone X Device version: e.g. iOS 14.0 Xcode version: e.g. Xcode 12.0

Configuration code of ZLPhotoConfiguration

   Paste your code here.
longitachi commented 1 year ago
ZLPhotoConfiguration.default()
    .editImageConfiguration
    .tools([.clip])
    .clipRatios([.wh1x1])

ZLPhotoConfiguration.default()
    .maxSelectCount(1)
    .editAfterSelectThumbnailImage(true)
    .showClipDirectlyIfOnlyHasClipTool(true)