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: 5301 - added an erasing tool for proofs #5341

Merged
merged 2 commits into from
Jun 7, 2024

Conversation

monsieurtanuki
Copy link
Contributor

What

  • Added an "eraser tool" when the user crops the proof image. The typical use case is barring sensitive data in a receipt, e.g. name or account number.

Screenshots

CropImage getCroppedBitmap
Screenshot_1717592735 Screenshot_1717592857

Uploaded image: https://prices.openfoodfacts.net/img/0003/pRFjLvNol8.jpg

Part of

Files

New files:

  • eraser_model.dart: Model about the eraser tool: coordinate computations.
  • eraser_painter.dart: Painter of the eraser tool: displaying thick lines.

Impacted files:

  • background_task_add_price.dart: displaying the eraser bars if relevant; new eraserCoordinates field
  • background_task_image.dart: minor refactoring
  • crop_helper.dart: new enableEraser field offsets parameters
  • crop_page.dart: added an erasing tool for proofs; refactored
  • crop_parameters.dart: new eraserCoordinates parameter
  • operation_type.dart unrelated minor refactoring
  • product_crop_helper.dart: minor refactoring
  • product_price_item.dart: unrelated fix for TEST env
  • proof_crop_helper.dart: minor refactoring
  • pubspec.lock: wtf
  • pubspec.yaml: needed upgrade of crop_image to 1.0.13

New files:
* `eraser_model.dart`: Model about the eraser tool: coordinate computations.
* `eraser_painter.dart`:  Painter of the eraser tool: displaying thick lines.

Impacted files:
* `background_task_add_price.dart`: displaying the eraser bars if relevant; new `eraserCoordinates` field
* `background_task_image.dart`: minor refactoring
* `crop_helper.dart`: new `enableEraser` field `offsets` parameters
* `crop_page.dart`: added an erasing tool for proofs; refactored
* `crop_parameters.dart`: new `eraserCoordinates` parameter
* `operation_type.dart` unrelated minor refactoring
* `product_crop_helper.dart`: minor refactoring
* `product_price_item.dart`: unrelated fix for TEST env
* `proof_crop_helper.dart`: minor refactoring
* `pubspec.lock`: wtf
* `pubspec.yaml`: needed upgrade of `crop_image` to `1.0.13`
@codecov-commenter
Copy link

codecov-commenter commented Jun 6, 2024

Codecov Report

Attention: Patch coverage is 0% with 215 lines in your changes missing coverage. Please review.

Project coverage is 7.58%. Comparing base (4d9c7fc) to head (ba174bf).
Report is 165 commits behind head on develop.

Files Patch % Lines
packages/smooth_app/lib/pages/crop_page.dart 0.00% 68 Missing ⚠️
...ages/smooth_app/lib/pages/prices/eraser_model.dart 0.00% 61 Missing ⚠️
...ages/smooth_app/lib/background/operation_type.dart 0.00% 27 Missing ⚠️
..._app/lib/background/background_task_add_price.dart 0.00% 23 Missing ⚠️
...es/smooth_app/lib/pages/prices/eraser_painter.dart 0.00% 20 Missing ⚠️
...mooth_app/lib/pages/prices/product_price_item.dart 0.00% 7 Missing ⚠️
packages/smooth_app/lib/pages/crop_helper.dart 0.00% 4 Missing ⚠️
...ooth_app/lib/background/background_task_image.dart 0.00% 3 Missing ⚠️
...ages/smooth_app/lib/pages/product_crop_helper.dart 0.00% 1 Missing ⚠️
...ckages/smooth_app/lib/pages/proof_crop_helper.dart 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           develop   #5341      +/-   ##
==========================================
- Coverage     9.54%   7.58%   -1.97%     
==========================================
  Files          325     373      +48     
  Lines        16411   18854    +2443     
==========================================
- Hits          1567    1430     -137     
- Misses       14844   17424    +2580     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@teolemon teolemon left a comment

Choose a reason for hiding this comment

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

I believe we also need #5318 to be on the safe side of things

@monsieurtanuki monsieurtanuki merged commit 036bda1 into openfoodfacts:develop Jun 7, 2024
6 checks passed
@monsieurtanuki
Copy link
Contributor Author

Thank you @teolemon for your review!

I believe we also need #5318 to be on the safe side of things

Working on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants