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: 2484 - now when editing we go to the full image with the cropped area on top #3658

Merged
merged 1 commit into from
Jan 30, 2023

Conversation

monsieurtanuki
Copy link
Contributor

Impacted files:

  • app_en.arb: added a label for the "send image" button (instead of vague "confirm")
  • background_task_crop.dart: added a product change where we store the crop parameters
  • background_task_image.dart: added a fake product change where we remove the crop parameters
  • new_crop_page.dart: added constructor parameters initialCropRect and initialRotation; removed the "new photo" button for UI/UX consistency
  • product_image_viewer.dart: refactored with 2 or 4 buttons and cleaner code
  • product_query.dart: added IMAGES product field
  • pubspec.lock: wtf
  • pubspec.yaml: upgraded openfoodfacts to 2.2.1 (about ProductImage)
  • rotation.dart: added method fromDegrees
  • up_to_date_changes.dart: added images to "overwritable" product fields; now accepts all operation types

What

  • Before, when we edited an image, we edited it as if it was a full image taken by the camera, even if it was cropped.
  • Now, we display the full image actually taken by the camera, with the visible cropped area on top.
  • Some changes on the buttons too, cf. screenshots.

Screenshot

read-only page crop page
Capture d’écran 2023-01-30 à 19 24 50 Capture d’écran 2023-01-30 à 19 24 29

Read-only page with no previous image:
Capture d’écran 2023-01-30 à 19 25 07

Fixes bug(s)

Part of

…d area on top

Impacted files:
* `app_en.arb`: added a label for the "send image" button (instead of vague "confirm")
* `background_task_crop.dart`: added a product change where we store the crop parameters
* `background_task_image.dart`: added a fake product change where we remove the crop parameters
* `new_crop_page.dart`: added constructor parameters `initialCropRect` and `initialRotation`; removed the "new photo" button for UI/UX consistency
* `product_image_viewer.dart`: refactored with 2 or 4 buttons and cleaner code
* `product_query.dart`: added `IMAGES` product field
* `pubspec.lock`: wtf
* `pubspec.yaml`: upgraded `openfoodfacts` to `2.2.1` (about `ProductImage`)
* `rotation.dart`: added method `fromDegrees`
* `up_to_date_changes.dart`: added `images` to "overwritable" product fields; now accepts all operation types
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.

Swell :-) 👍

@codecov-commenter
Copy link

Codecov Report

Merging #3658 (326bcc1) into develop (7121b0e) will decrease coverage by 0.09%.
The diff coverage is 0.00%.

@@             Coverage Diff             @@
##           develop    #3658      +/-   ##
===========================================
- Coverage    10.65%   10.56%   -0.09%     
===========================================
  Files          270      270              
  Lines        13474    13584     +110     
===========================================
  Hits          1435     1435              
- Misses       12039    12149     +110     
Impacted Files Coverage Δ
...mooth_app/lib/background/background_task_crop.dart 0.00% <0.00%> (ø)
...ooth_app/lib/background/background_task_image.dart 0.00% <0.00%> (ø)
...smooth_app/lib/data_models/up_to_date_changes.dart 0.00% <0.00%> (ø)
...th_app/lib/pages/product/product_image_viewer.dart 0.00% <0.00%> (ø)
packages/smooth_app/lib/query/product_query.dart 8.10% <ø> (ø)
...s/smooth_app/lib/tmp_crop_image/new_crop_page.dart 0.00% <0.00%> (ø)
...ckages/smooth_app/lib/tmp_crop_image/rotation.dart 1.69% <0.00%> (-0.10%) ⬇️
...pp/lib/pages/product/common/product_list_page.dart 0.00% <0.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@monsieurtanuki monsieurtanuki merged commit 8b38a72 into openfoodfacts:develop Jan 30, 2023
@monsieurtanuki
Copy link
Contributor Author

Thank you @teolemon for the review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants