talent-connect / connect

Mentor-mentee and jobseeker-company matchmaking platform used by ReDI School of Digital Integration, in Berlin, Munich and Düsseldorf, Germany.
https://connect.berlin.redi-school.org
24 stars 8 forks source link

[CON & TP/Picture display:] Show full face/logo of person #534

Closed miriam-aha closed 1 year ago

miriam-aha commented 2 years ago

Context/background

Currently, when users upload their pictures to ReDI Connect or Talent Pool, they are automatically cropped by the system resulting in many headless mentors or other unfortunate views in their profile cards.

This issue affects the following cases:

  1. CON: Pictures of mentors when mentees browse through the mentor profile cards (rectangular format)
  2. TP: Pictures of jobseekers when company recruiters browse through the jobseeker profile cards (should be also rectangular format)
  3. TP: Company logos shown in job postings - both in job posting card view (rectangular format), but the main issue is with the circular format in the

What needs to be done?

Screenshot 2022-02-28 at 17 49 29 Screenshot 2022-02-28 at 17 46 54
lorepirri commented 2 years ago

Explore https://imagekit.io/ to center the image of a person-profile to the face of a person

pilauria commented 2 years ago

Selection of free cropper libraries that can do the work:

ericbolikowski commented 2 years ago

Thanks @pilauria. I'll review them tomorrow to add my two cents to the discussion.

helloanil commented 2 years ago

Selection of free cropper libraries that can do the work:

Other (in vanilla JS)

  • cropperjs : one of the most used. When hovering over the uploaded image you can scroll in and out using your mouse wheel to zoom. This also supports pinching and touch-based input devices.
  • smartcrop.js: it has its own proprietary algorithm to recognize faces, compositions, and define a “good crop” after you click the upload button.
  • Tinycrop
  • Croppie: minimalist.

Great stuff @pilauria. I think all of them would work for us but I especially liked two of them as they are really intuitive to use and also easy to implement:

If @ericbolikowski also agrees, we can simply pick one of them and start implementing. However, since our current flow doesn't have an extra step of image cropping, we need to introduce a UI to allow users to do this. My recommendation would be this:

  1. Clicking on the Edit Photo when you hover on the Profile Picture, will open up a modal, instead of the native file selector:

CleanShot 2022-03-22 at 09 38 28

  1. In the modal, we'll have three things:

Note: react-avatar-editor seems to be supporting a file input out of the box. That's great. react-easy-crop instead expects a string which might force us to add an extra step of converting the selected file into a string somehow. So, react-avatar-editor is a tiny bit forward in the race of options for me :)

  1. When the user selects the file, crops it as they want and clicks on the Save button, we'll finalize the process by uploading the cropped image to S3, as we do right now on the callback of file selection.
pilauria commented 2 years ago

Ok, @helloanil, thanks for the feedback. We'll tackle the problem as soon as @ericbolikowski checks out your inputs👍🏽

ericbolikowski commented 2 years ago

My vote goes with react-easy-crop:

I think there's basically two ways to integrate with what we've already got:

  1. On file select, use the current solution to actually upload the image to S3 before we do any cropping. Let the user do the cropping. On final "Save" action, we basically save two things: (1) the URL to the S3 uploaded image (which we already do with present solution), and (2) save the "crop rectangle" (or circle) which we then later use
  2. User picks image, user crops image, we programatically crop the image, get cropped image, upload cropped image to S3

Beware, I think option number 2 here would be tricky to integrate with the uploader mechanism we're using (react-s3-uploader). That is abandonware by now, and I recall it being hard to work with. Simply looking at the props it accepts, here's some speculation about how we might make it work:

Again - this is speculation. Recommend some quick prototyping to figure out if the above is feasible or not. Worst case scenario is that we have to drop react-s3-uploader completely, replacing it with one of these:

  1. Another lib/dependency that does the same
  2. We write our own upload mechanism from scratch (sounds like fun to me!)
  3. We "copy paste" the source code of react-s3-uploader into a lib in our monorepo and tweak its source code to fit our needs
patriciaredi commented 1 year ago

We need to ask companies to use another logo (this happens on LinkedIn too)

katamatata commented 1 year ago

We have a new design of the mentor/mentee profile cards to be implemented in #681.