-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[HOLD for payment 1/12][$8000] Profile - Create a limit for Avatar file types or size #13006
Comments
Triggered auto assignment to @Christinadobrzyn ( |
The image is 9001px by 9000px |
I am not able to replicate this. Staging v1.2.32-1
Image used 80kb: Based on the chat in the Slack link and as @s77rt mentioned, this seems to be an issue with large images. Do we want to change the focus of this to compress images before uploading or send a popup asking for a lighter image?
|
I like these ideas (prefer asking for a smaller image) - added my comments in Slack! |
I think we need to figure out what is causing the issue b/c it sounds like it might not be file size based on this comment. The avatar limit code is here: AVATAR_MAX_ATTACHMENT_SIZE: 6291456 The image that @hungvu193 has very high pixelation - maybe that's the issue? @hungvu193 or @kavimuru do you have another image with a heavy pixelation/DPI that we can test? |
Kinda came to a resolution in the Slack convo but love to get your thoughts on what to do next with this GH @Beamanator |
Adding myself here too b/c I'm involved in lots of avatar-related issues, and this is very intriguing 😅 Also noting (as is noted in Slack) this is the same as #13005, which was closed w/out reproduction but it seems there's a few images we can use to reproduce at the moment (in Slack):
|
Thanks @Beamanator and @hungvu193! I updated the title and the OP to hopefully match what we're looking for. Going to all the external label. |
Current assignee @Christinadobrzyn is eligible for the External assigner, not assigning anyone new. |
Job added to Upwork: https://www.upwork.com/jobs/~017185b708f6ccd9fb |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @sobitneupane ( |
Current assignee @Beamanator is eligible for the External assigner, not assigning anyone new. |
Proposal Lines 31 to 34 in e82bcf6
Solution + AVATAR_MAX_WIDTH_PX: 4000,
+ AVATAR_MAX_HEIGHT_PX: 4000, Also need to update the /**
* Check if the attachment resolution is bigger than required.
*
* @param {String} imageUri
* @returns {Promise}
*/
isValidResolution(imageUri) {
return new Promise((resolve) => {
Image.getSize(imageUri, (width, height) => {
resolve((height >= CONST.AVATAR_MIN_HEIGHT_PX && height <= CONST.AVATAR_MAX_HEIGHT_PX) && (width >= CONST.AVATAR_MIN_WIDTH_PX && width <= CONST.AVATAR_MAX_WIDTH_PX));
});
});
} Since we change the validation we need to update error message in here too, can some one provide me it. For now I leave it like this this.isValidResolution(image.uri)
.then((isValidResolution) => {
if (!isValidResolution) {
this.showErrorModal(
this.props.translate('avatarWithImagePicker.imageUploadFailed'),
this.props.translate('avatarWithImagePicker.tooSmallResolution', {
minHeightInPx: CONST.AVATAR_MIN_HEIGHT_PX,
minWidthInPx: CONST.AVATAR_MIN_WIDTH_PX,
maxHeightInPx: CONST.AVATAR_MAX_HEIGHT_PX,
maxWidthInPx: CONST.AVATAR_MAX_WIDTH_PX,
}),
);
return;
} tooSmallResolution: ({
minHeightInPx, minWidthInPx, maxHeightInPx, maxWidthInPx,
}) => `Please upload an image larger than ${minHeightInPx}x${minWidthInPx} pixels and smaller than ${maxHeightInPx}x${maxWidthInPx} pixels`, Result: Untitled.mov |
Here are some file size limits for other social media sites. Maybe we should use these? FB Avatar size: WhatsApp Profile Image Size – 500 x 500 px |
@Christinadobrzyn That's fine I think, but should we post this in slack for discussion as well, just to make sure everyone agree with it. |
I believe next step here is to determine file size limit and the error message to display when file size is outside the scope. Having said that the proposal from @hungvu193 looks good to me. |
Hey @Beamanator can you take a peek at #13006 (comment) and let me know if you agree? Thanks! |
Interesting, here's what I'm seeing in different platforms:
Personally I'd love to not see the error message, and instead maybe warn the user that we'll decrease the photo quality before uploading (or do this automatically if possible). |
@tgolen addressed your feedback by extracting |
📣 @azimgd You have been assigned to this job by @mallenexpensify! |
Assigned issue to and hired @azimgd can you please accept the job and reply here once you have? @sobitneupane, can you do the same plz |
applied |
ready for review 👆 |
|
@tgolen, @azimgd, @mallenexpensify, @sobitneupane, @kavimuru, @Christinadobrzyn Whoops! This issue is 2 days overdue. Let's get this updated quick! |
Deployed to Production on Jan 5, updating title to pay on 1/12 I wonder why auto-bots didn't work for updating, maybe cuz there was additional data here in the PR?
|
Hired Dec 29th, Merged Jan 3, eligible for the 50% bonus (weekend and holiday in between) @azimgd and @sobitneupane paid $12,000 |
@mallenexpensify I've just applied, thank you |
sorry, @mallenexpensify, would you be able to pay this? I'm really sick today and going to take ooo. thank you for taking it |
@hungvu193 paid, thanks! For regression test steps, proposing
@tgolen @sobitneupane can you finish the top three items on the checklist? BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
|
Should have feedback on the regression test steps by Monday |
I think this bug was present from the very beginning. This feature was implemented in #8511. |
Thanks @sobitneupane , waiting for 👀 on the regression test steps |
@tgolen @mallenexpensify Be sure to fill out the Contact List! |
Regression test added https://github.com/Expensify/Expensify/issues/256180 |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Action Performed:
Expected Result:
Actual Result:
Slider can't not be scrolled for a while and it's delayed after that.
Based on our code we have:
Max size: 6291456
Min Width: 80
Min Height: 80
Max Width: XX
Max Height: XX
We need to figure out what is causing this issue (is it pixels, weight, file type) and create an error message for the user
Platform:
Where is this issue occurring?
Version Number: 1.2.31-5
Reproducible in staging?: Y
Reproducible in production?: Y
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos:
https://user-images.githubusercontent.com/43996225/203830021-84c9a597-6507-490b-881e-fb08fe57c900.mov
https://user-images.githubusercontent.com/43996225/203830045-659ad4c2-2fc4-4d86-870c-c3cb6338284f.mp4
Used this image :
Expensify/Expensify Issue URL:
Issue reported by: @hungvu193
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1669089889220939
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: