-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Android - Avatar- SVG file as avatar able to select in Android #38211
Comments
Triggered auto assignment to @kevinksullivan ( |
@kevinksullivan I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors. |
We think that this bug might be related to #vip-vsb |
ProposalPlease re-state the problem that we are trying to solve in this issue.SVG allowed on Android What is the root cause of that problem?We are mentioning SVG as a valid extention here: App/src/components/AvatarWithImagePicker.tsx Lines 177 to 180 in f52bb02
What changes do you think we should make in order to solve the problem?Check the device type (Android as QA) and do not set SVG as valid here: App/src/components/AvatarWithImagePicker.tsx Lines 177 to 180 in f52bb02
- AVATAR_ALLOWED_EXTENSIONS: ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'svg'],
+ AVATAR_ALLOWED_EXTENSIONS_ANDROID: ['jpg', 'jpeg', 'png', 'gif', 'bmp'], Then set the correct error for Android here: App/src/components/AvatarWithImagePicker.tsx Lines 198 to 228 in f52bb02
- Profile picture must be one of the following types: jpg, jpeg, png, gif, bmp, svg.
+ Profile picture must be one of the following types: jpg, jpeg, png, gif, bmp. What alternative solutions did you explore? (Optional) |
ProposalPlease re-state the problem that we are trying to solve in this issue.User is able to select SVG but the app gives size error. What is the root cause of that problem?When we select an image attachment, it will try to get the width and height of the image. App/src/components/AttachmentPicker/index.native.js Lines 270 to 278 in f52bb02
However, This started to happen when we allowed the user to pick an image from a document picker and it allows to select any type of image. App/src/components/AttachmentPicker/index.native.js Lines 67 to 69 in f52bb02
What changes do you think we should make in order to solve the problem?Only allow users to select images that are supported by RN. // for android
type: ['image/png', 'image/jpg', 'image/jpeg', 'image/bmp', 'image/gif', 'image/webp'],
// for iOS: from https://developer.apple.com/documentation/uniformtypeidentifiers/system-declared_uniform_type_identifiers#3590524
type: ['public.png', 'public.jpeg', 'com.microsoft.bmp', etc.], |
hm I just don't really think this is worth fixing right now. |
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Version Number: 1.4.51
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/4421959
Logs: https://stackoverflow.com/c/expensify/questions/4856
Issue reported by: Applause-Internal team
Action Performed:
Expected Result:
When user uploads svg file as avatar, it must display correct error message that svg file is not supported or it must not allow to select unsupported files.
Actual Result:
User allowed to select svg file as avatar. When user uploads svg file as avatar, it displays incorrect error " Please upload an image larger than 8080 pixels and smaller than 40o64096 pixels.
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Bug6411919_1710308315204.documents.mp4
View all open jobs on GitHub
The text was updated successfully, but these errors were encountered: