-
Notifications
You must be signed in to change notification settings - Fork 510
Add picture to personal data #6160
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
Add picture to personal data #6160
Conversation
|
Does this need a new |
Well, to be complete, it's not only a placeholder in designer, but should also be in:
|
|
I think adding a placeholder to include it on badge would make sense in this PR. I guess that's something you guys need anyway? |
Done. |
There are still some lint/test issues, could you fix them? |
Done. |
...tions/versions/20240130_1531_17996ef18cb9_update_constraint_valid_enum_personal_data_type.py
Outdated
Show resolved
Hide resolved
|
I removed the picture from get_personal_data and added a stand-alone get_personal_data_picture, which will be used anytime the picture needs to be retrieved (to avoid having to build the whole personal data dict). |
cc9d2b2 to
10b8a43
Compare
ThiefMaster
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fixed a bunch of bugs, I think this is fine now. But have a quick look over my fixes.
|
One thing that might be worth fixing here is the fact that the aspect ratio is not honored when the picture is rendered on a badge. Cropping may lose some important data, so maybe it should be resized so it fits in the size of the badge placeholder (and then just has some more blank space around it when the aspect ratios don't match) |
|
I tested with all your changes, it's fine, nothing broken. |
|
Squeezing the image in such a way feels like a bug to me that should be fixed before merging it upstream... |
|
Ok for you if I use the default 'preserveAspectRatio' of the library ? |
|
Not sure if that would work since you can still upload any aspect ratio (seems reasonable, the user may upload a landscape picture but then crop it to only have the relevant part with their picture which is not landscape anymore), and the badge template is completely unrelated to that. Maybe the regform picture field needs a setting to enforce a certain aspect ratio in case this is needed (actually I'm surprised you do not have this requirement at the UN - the last time I got a UN badge my photo was actually squished which did not look very flattering; some people might even be annoyed/offended by that ;)) |
|
I did a test with the case you mentioned: upload a landscape pict, crop to get just the face part, the rendering is correct with preserveAspectRatio, as the picture saved is the new one created from the crop, with the format of the crop and not the landscape format anymore. |
|
But how will that help when it gets squeezed in the size of the placeholder in the badge template? If that placeholder is square and the image is e.g. in 2:3 format, it will still get squished, won't it? |
|
It will be rendered in 2:3 format, with blank to fill the placeholder. |
|
The placeholder is a square, and the picture uploaded in 2:3, the rendering is 2:3. |
|
looks good :) |
|
How about my suggestion to change the _reglist.html ? |
|
I don't see where you made that... (or is it new?). Anyway, this is generic and not specific to the picture field, so I'd prefer to use the same logic we use in other places in the template. |
|
All done on my side related to your review. |
|
Oh now I understand after seeing your commit. I did not expect camelCase in the Python code so I assumed this is a prop you pass somewhere on the image cropping UI of the regform! |
Co-authored-by: Adrian <[email protected]>
This breaks because user.picture contains the raw image data.
Matching the behavior used for custom fields
f2f4603 to
0f4bd2c
Compare


Request to add the picture to personal data type of registration.
This will help to display picture for registrations in Participant List or Badges.