Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Require image clipping #838

Open
patryk-sredzinski opened this issue Jul 26, 2023 · 6 comments
Open

Require image clipping #838

patryk-sredzinski opened this issue Jul 26, 2023 · 6 comments

Comments

@patryk-sredzinski
Copy link
Contributor

Feature Description

I am in a need to force user to crop image to square/circle (when he edits a profile avatar)
I don't think I have seen this feature available. Planning to modify it.

Can I get any suggestions so in the end it get's merged?

@longitachi
Copy link
Owner

ZLPhotoConfiguration.default()
    .editImageConfiguration
    .clipRatios([.circle]) // or  .clipRatios([.wh1x1])

@patryk-sredzinski
Copy link
Contributor Author

This I believe only adds clip ratio, but user is still able to not to enter clipping controller, and keep original photo.

I'd like to make him forced to clip, and also allow editing the image

@longitachi
Copy link
Owner

OK, this configuration can meet your needs

ZLPhotoConfiguration.default()
    .editImageConfiguration
    .tools([.clip])
    .clipRatios([.circle]) // or  .clipRatios([.wh1x1])

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

@patryk-sredzinski
Copy link
Contributor Author

Yeah, but I believe this will not let me do other editing on image right? No Drawings, no sticker, no filters.

That's why I think I'd like to add this functionality, but I'd like you to help me planning it so it works well.

@longitachi
Copy link
Owner

longitachi commented Jul 26, 2023

Delete .tools([.clip]) and .showClipDirectlyIfOnlyHasClipTool(true). But in this case, the user can choose not to enter the cropping interface.

So now there is no good way to support your needs.

@patryk-sredzinski
Copy link
Contributor Author

Yeah, that's why I'd like to ask you what do you think I can do as a new functionality for it to be supported properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants