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: 2424 - new "select existing images" button #3641

Merged
merged 3 commits into from Jan 27, 2023

Conversation

monsieurtanuki
Copy link
Contributor

New files:

  • background_task_crop.dart: Background task about product image crop from existing file.
  • uploaded_image_gallery.dart: Gallery of all images already uploaded, about a given product.

Deleted file:

  • smooth_images_sliver_grid.dart

Impacted files:

  • abstract_background_task.dart: added reference to new "crop" task
  • app_en.arb: added 4 labels about "existing images" (button, page title, downloading, nothing found)
  • image_crop_page.dart: refactored moving code here from ProductImageViewer
  • new_crop_page.dart: now we can handle "already existing" images, in addition to the current choice for e.g. NUTRITION_FR
  • operation_type.dart: added reference to new "crop" task
  • product_image_swipeable_view.dart: unrelated fix - the title of the first reached page was always the title of the first page to the left
  • product_image_viewer.dart: added a "select existing image" button; moved code to image_crop_page.dart
  • pubspec.lock: wtf
  • pubspec.yaml: upgraded off-dart in order to user new methods

What

  • New "select existing images" button.
  • From there you open a new "existing images" gallery, latest images first.
  • Clicking on an image from the gallery, you land on the crop page.
  • The "confirm" button on the crop page sets the product / imageField / language image as the crop of the existing image, without any upload (which is much quicker)

Screenshot

new button new gallery
Capture d’écran 2023-01-26 à 14 33 12 Capture d’écran 2023-01-26 à 14 31 45

Fixes bug(s)

Part of

New files:
* `background_task_crop.dart`: Background task about product image crop from existing file.
* `uploaded_image_gallery.dart`: Gallery of all images already uploaded, about a given product.

Delete file:
* `smooth_images_sliver_grid.dart`

Impacted files:
* `abstract_background_task.dart`: added reference to "crop" task
* `app_en.arb`: added 4 labels about "existing images" (button, page title, downloading, nothing found)
* `image_crop_page.dart`: refactored moving code here from `ProductImageViewer`
* `new_crop_page.dart`: now we can handle "already existing" images, in addition to the current choice for e.g. NUTRITION_FR
* `operation_type.dart`: added reference to new "crop" task
* `product_image_swipeable_view.dart`: unrelated fix - the title of the first reached page was always the title of the first page to the left
* `product_image_viewer.dart`: added a "select existing image" button; moved code to `image_crop_page.dart`
* `pubspec.lock`: wtf
* `pubspec.yaml`: upgraded off-dart in order to user new methods
@teolemon
Copy link
Member

Resolving dependencies...
Because smooth_app depends on openfoodfacts from path which doesn't exist (could not find package openfoodfacts at "../../../openfoodfacts-dart"), version solving failed.
pub finished with exit code 66

Impacted files:
* `pubspec.lock`: wtf
* `pubspec.yaml`: upgraded off-dart in order to user new methods
@monsieurtanuki monsieurtanuki marked this pull request as ready for review January 26, 2023 19:03
@monsieurtanuki monsieurtanuki requested a review from a team as a code owner January 26, 2023 19:03
@monsieurtanuki
Copy link
Contributor Author

Resolving dependencies...

@teolemon It was just a draft as I needed off-dart 2.2.0. I didn't want my code to be lost locally if I or my macbook die - whichever comes first. Looks like we're both OK ;)

Next step is "this image was computed from that uploaded image and those crop parameters, so if I edit it I should see the uploaded image and the crop parameters, not directly the cropped image".

But first, this PR.

@monsieurtanuki monsieurtanuki merged commit 7121b0e into openfoodfacts:develop Jan 27, 2023
@monsieurtanuki
Copy link
Contributor Author

Thank you @teolemon for the review!
I think we'll be done with most "new" image features by the end of the week.
Then, some UX-refining.

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

Successfully merging this pull request may close these issues.

Add image selection from server in the Photo Manager (the expanded view accessible from the carousel)
2 participants