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

feat: strip metadata from profile pictures (WPB-11170) #3590

Merged
merged 18 commits into from
Nov 8, 2024

Conversation

yamilmedina
Copy link
Contributor

@yamilmedina yamilmedina commented Nov 5, 2024

TaskWPB-11170 [Android] Strip Exif data from profile pictures before upload


PR Submission Checklist for internal contributors

  • The PR Title

    • conforms to the style of semantic commits messages¹ supported in Wire's Github Workflow²
    • contains a reference JIRA issue number like SQPIT-764
    • answers the question: If merged, this PR will: ... ³
  • The PR Description

    • is free of optional paragraphs and you have filled the relevant parts to the best of your ability

What's new in this PR?

Issues

Make sure that we don't upload Exif metadata to profile pictures.

Solutions

  • Introduce ExifHandler, so we centralized in there, Exif manipulation of images
  • Removes unnecessary metadata (keeping Orientation)
  • Paying tech debt, old logic performed in the UI, now is moved to the ViewModel and remove unused code.

Dependencies (Optional)

wireapp/kalium#3089

Needs releases with:

  • GitHub link to other pull request

Testing

Test Coverage (Optional)

  • I have added automated test to this contribution

Attachments (Optional)

Original image

Screen.Recording.2024-11-04.at.17.34.00.mov

Uploading avatar:

Screen.Recording.2024-11-04.at.17.34.37.mov

Result uploaded image:

Screen.Recording.2024-11-04.at.17.39.22.mov

PR Post Submission Checklist for internal contributors (Optional)

  • Wire's Github Workflow has automatically linked the PR to a JIRA issue

PR Post Merge Checklist for internal contributors

  • If any soft of configuration variable was introduced by this PR, it has been added to the relevant documents and the CI jobs have been updated.

References
  1. https://sparkbox.com/foundry/semantic_commit_messages
  2. https://github.com/wireapp/.github#usage
  3. E.g. feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764.

@yamilmedina yamilmedina self-assigned this Nov 5, 2024
@echoes-hq echoes-hq bot added the echoes: product-roadmap Work aligned with the customer-announced roadmap, targeting a specific release date. label Nov 5, 2024
@yamilmedina yamilmedina requested review from borichellow, Garzas, saleniuk, a team, m-zagorski and vitorhugods and removed request for a team November 5, 2024 16:37
@codecov-commenter
Copy link

codecov-commenter commented Nov 5, 2024

Codecov Report

Attention: Patch coverage is 86.80203% with 26 lines in your changes missing coverage. Please review.

Project coverage is 45.99%. Comparing base (e3c1dee) to head (ef361ff).
Report is 2 commits behind head on develop.

Files with missing lines Patch % Lines
...c/main/kotlin/com/wire/android/util/ExifHandler.kt 91.66% 14 Missing ⚠️
...src/main/kotlin/com/wire/android/util/ImageUtil.kt 52.63% 7 Missing and 2 partials ⚠️
.../src/main/kotlin/com/wire/android/util/FileUtil.kt 0.00% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3590      +/-   ##
===========================================
+ Coverage    45.33%   45.99%   +0.65%     
===========================================
  Files          472      472              
  Lines        15794    15948     +154     
  Branches      2632     2630       -2     
===========================================
+ Hits          7160     7335     +175     
+ Misses        7884     7855      -29     
- Partials       750      758       +8     
Files with missing lines Coverage Δ
.../userprofile/avatarpicker/AvatarPickerViewModel.kt 89.87% <100.00%> (+0.83%) ⬆️
...id/ui/userprofile/self/SelfUserProfileViewModel.kt 56.71% <ø> (+3.65%) ⬆️
.../src/main/kotlin/com/wire/android/util/FileUtil.kt 18.66% <0.00%> (+0.28%) ⬆️
...src/main/kotlin/com/wire/android/util/ImageUtil.kt 33.33% <52.63%> (+31.51%) ⬆️
...c/main/kotlin/com/wire/android/util/ExifHandler.kt 91.66% <91.66%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e3c1dee...ef361ff. Read the comment docs.

Copy link
Contributor

github-actions bot commented Nov 5, 2024

Built wire-android-staging-compat-pr-3590.apk is available for download

Copy link
Contributor

github-actions bot commented Nov 5, 2024

Built wire-android-dev-debug-pr-3590.apk is available for download

Copy link
Contributor

github-actions bot commented Nov 7, 2024

Built wire-android-staging-compat-pr-3590.apk is available for download

Copy link
Contributor

github-actions bot commented Nov 7, 2024

Built wire-android-dev-debug-pr-3590.apk is available for download

Copy link
Contributor

@Garzas Garzas left a comment

Choose a reason for hiding this comment

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

Looking good, just one comment about logs 😄

@yamilmedina yamilmedina added this pull request to the merge queue Nov 8, 2024
@yamilmedina yamilmedina disabled auto-merge November 8, 2024 07:49
@yamilmedina yamilmedina removed this pull request from the merge queue due to a manual request Nov 8, 2024
@yamilmedina yamilmedina enabled auto-merge November 8, 2024 08:34
Copy link

sonarqubecloud bot commented Nov 8, 2024

@yamilmedina yamilmedina added this pull request to the merge queue Nov 8, 2024
Copy link
Contributor

github-actions bot commented Nov 8, 2024

Built wire-android-staging-compat-pr-3590.apk is available for download

Copy link
Contributor

github-actions bot commented Nov 8, 2024

Built wire-android-dev-debug-pr-3590.apk is available for download

Merged via the queue into develop with commit 121fb3e Nov 8, 2024
11 of 12 checks passed
@yamilmedina yamilmedina deleted the feat/strip-metadata-profilepics branch November 8, 2024 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
echoes: product-roadmap Work aligned with the customer-announced roadmap, targeting a specific release date. size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants