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

Enhancement/128 ”Skip cropping” + “Free cropping area” added! #130

Merged
merged 2 commits into from
May 19, 2022

Conversation

faisal-alvi
Copy link
Member

@faisal-alvi faisal-alvi commented May 18, 2022

Description of the Change

  • This PR introduces a new button “Skip cropping”, similarly to how the site icon is handled.
  • And, the “Free cropping” area feature for avatar crops.

Closes #128

Alternate Designs

Screen Shot 2022-05-13 at 9 45 08 AM

Possible Drawbacks

No more square restrictions in the crop, so the users who want it to be strict "Square", may have to manually crop the image and try to make it square. :|

Verification Process

  1. Build the project npm run build.
  2. Visit Users > Profile.
  3. Click the “Choose from Media Library” button.
  4. Select/Upload any image.
  5. Click the “Select avatar and Crop” button.
  6. Try to change the cropping area to any size and shape.
  7. At the bottom right of the popup, see the “Skip cropping” button. Try using it.
  8. Also, try cropping various shapes and see if that works.

Checklist:

  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests passed.

Changelog Entry

Added - “Skip cropping” button added.
Added - Free Cropping area introduced, no more strict squares!

Credits

Props @dkotter @faisal-alvi @cadic

@faisal-alvi faisal-alvi added this to the 2.5.0 milestone May 18, 2022
@faisal-alvi faisal-alvi requested a review from a team May 18, 2022 12:58
@faisal-alvi faisal-alvi self-assigned this May 18, 2022
@faisal-alvi faisal-alvi requested review from cadic and removed request for a team May 18, 2022 12:58
cadic
cadic previously approved these changes May 19, 2022
Copy link
Contributor

@cadic cadic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good, except one small indent problem

assets/js/simple-local-avatars.js Outdated Show resolved Hide resolved
@faisal-alvi faisal-alvi requested a review from cadic May 19, 2022 08:41
@jeffpaul jeffpaul merged commit 4b1155d into develop May 19, 2022
@jeffpaul jeffpaul deleted the Enhancement/128 branch May 19, 2022 18:03
@dkotter
Copy link
Collaborator

dkotter commented May 19, 2022

I know this has been merged already but is it worth discussing this Possible Drawbacks point:

No more square restrictions in the crop, so the users who want it to be strict "Square", may have to manually crop the image and try to make it square

In the issue I opened, I mentioned that it seemed like we should allow crops other than squares but that is only my opinion. I'm assuming the decision was made initially to force this to a square for a particular reason, so just want to see if there's any other feedback on that before this is shipped? I think for sure the "skip crop" option is needed but there may be a good reason to keep the square size restriction

@jeffpaul
Copy link
Member

Any chance that it supports a shift+click function that locks the crop ratio to a square? I agree that it would be nice to keep it "simple" for someone to crop in a square while still allowing for non-square crops for whatever reason (like the one in the original dotorg report).

@faisal-alvi
Copy link
Member Author

Agree, I will check about shift+click or any other possibilities, otherwise, we might have to add a custom button for square shape.

An example screenshot from https://www.fotor.com/features/crop,

image

@cadic
Copy link
Contributor

cadic commented May 20, 2022

Maybe there is a change to overload the onSelectChange event of imgAreaSelect jQuery plugin which is used to crop attachments?

https://github.com/WordPress/WordPress/blob/766a38f2fb420aafb9049ffe43e4a04f35a0c7c8/wp-admin/js/image-edit.js#L786-L800

@victorberland
Copy link

Is there an ETA for when this will be released?

@faisal-alvi
Copy link
Member Author

faisal-alvi commented Jun 3, 2022

@victorberland this is on hold to be released until #131 is implemented because as per discussion in #130 (comment), we have to consider the following possible drawback. So probably, this would be implemented by the end of this month and released the early next month. 🤞🏻

No more square restrictions in the crop, so the users who want it to be strict "Square", may have to manually crop the image and try to make it square

@faisal-alvi
Copy link
Member Author

Is there an ETA for when this will be released?

@victorberland we are glad to inform you that we have a new release v2.5.0 which contains the "Skip cropping" button from this PR.

https://wordpress.org/plugins/simple-local-avatars/

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

Successfully merging this pull request may close these issues.

Crop changes: skip cropping; allow non-square crops
5 participants