longitachi / ZLPhotoBrowser

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

功能建议,单选时,增加裁剪功能 #729

Closed zhou7126 closed 2 years ago

zhou7126 commented 2 years ago

在最大选择张数为1时,图片列表页点击后就进入一个裁剪页,图片可以拖动和缩放,其他编辑功能就不要,在用户上传头像的场景很实用,因为头像宽高一般为1:1,有的还会要圆形和压缩。像这样: WechatIMG42

longitachi commented 2 years ago

现在就支持

let editImageConfiguration = ZLPhotoConfiguration.default().editImageConfiguration
editImageConfiguration
    .tools([.clip])
    .clipRatios([.wh1x1])

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