Wechat-like image picker. Support select photos, videos, gif and livePhoto. Support edit image and crop video. 微信样式的图片选择器,支持预览/相册内拍照及录视频、拖拽/滑动选择,编辑图片/视频,支持多语言国际化等功能;
MIT License
4.8k
stars
975
forks
source link
feat(camera): wide zoom cameras in custom camera #948
Hey again @longitachi, thanks for reviewing my previous PRs, here is another one.
This PR introduces a new feature to the ZLCustomCamera that allows users to utilize wide cameras (e.g., .builtInTripleCamera, .builtInDualWideCamera, .builtInDualCamera). This enhancement is designed to improve the flexibility and functionality of the camera, especially for users who need to capture wider shots. And it's also a feature that exists in the original UIImagePickerController but is missing in ZLCustomCamera.
Key Changes
Added a new boolean property enableWideCameras to ZLCameraConfiguration.
Updated the getCamera method in ZLCustomCamera to include the cameraConfig.enableWideCameras flag check along with the #available check.
Modified the setInitialZoomFactor method in ZLCustomCamera to use an early return with the guard statement if cameraConfig.enableWideCameras is false.
Enhanced the setVideoZoomFactor method in ZLCustomCamera to use the new implementation only if cameraConfig.enableWideCameras is true. Otherwise, it uses the original implementation.
Benefits
Flexibility: This feature allows users to take advantage of wide cameras, providing more options for capturing photos and videos.
User Experience: Users can now capture wider shots, which is especially useful for landscape photography, group photos, and more.
Non-Breaking Change
This change is non-breaking and does not affect existing functionality. The wide camera feature is disabled by default and can be enabled by setting the enableWideCameras parameter to true.
Please review the changes and let me know if there are any adjustments or additional features you would like to include. Thank you!
Hey again @longitachi, thanks for reviewing my previous PRs, here is another one.
This PR introduces a new feature to the
ZLCustomCamera
that allows users to utilize wide cameras (e.g., .builtInTripleCamera, .builtInDualWideCamera, .builtInDualCamera). This enhancement is designed to improve the flexibility and functionality of the camera, especially for users who need to capture wider shots. And it's also a feature that exists in the originalUIImagePickerController
but is missing inZLCustomCamera
.Key Changes
Added a new boolean property
enableWideCameras
toZLCameraConfiguration
.Updated the getCamera method in
ZLCustomCamera
to include thecameraConfig.enableWideCameras
flag check along with the #available check.Modified the
setInitialZoomFactor
method inZLCustomCamera
to use an early return with the guard statement ifcameraConfig.enableWideCameras
is false.Enhanced the
setVideoZoomFactor
method inZLCustomCamera
to use the new implementation only ifcameraConfig.enableWideCameras
is true. Otherwise, it uses the original implementation.Benefits
Flexibility: This feature allows users to take advantage of wide cameras, providing more options for capturing photos and videos.
User Experience: Users can now capture wider shots, which is especially useful for landscape photography, group photos, and more.
Non-Breaking Change
This change is non-breaking and does not affect existing functionality. The wide camera feature is disabled by default and can be enabled by setting the
enableWideCameras
parameter to true.Please review the changes and let me know if there are any adjustments or additional features you would like to include. Thank you!