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

crop_image_feature #1153

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

crop_image_feature #1153

wants to merge 2 commits into from

Conversation

chaneylc
Copy link
Member

@chaneylc chaneylc commented Jan 31, 2025

Description

Photo traits can now define a crop region.

Workflow:
User must enable crop in trait definition, right now it is set to false as default. Like other trait parameters, this cannot be edited if data for that trait is already captured.

When observing data for that photo trait, the user can click the settings and define a crop region, or a dialog will show if the trait requires cropping and no region is defined when a photo is taken. In the latter case, the photo will be cropped and saved.

This feature introduced CropImageView which I added a fragment controller implementation along with an activity wrapper for the fragment. This is a modular and independent view, but requires two intent-based parameters, traitId (internal db id of the trait to update the crop region) and imageUri for the image to preview as it is cropped.

UI:
The CropImageView has a couple functionalities:

  1. Users can drag the 4 boundary handles (top, bottom, start, end) within the bounds of the image to adjust ROI size
  2. Users can drag the middle handle to move the entire region
  3. Users can click save to save the rectangle coordinates to preferences for that trait
  4. Users can click copy to save the rectangle coordinates to clipboard
  5. Users can click reset to reset coordinates to the currently saved preferences
  6. Users can click expand to reset coordinate to the image dimensions
  7. Users can click/edit coordinate edit text, but coordinates will not be updated/invalidated unless the ACTION_DONE ime is pressed (the enter button)

Working with multiple devices:
User 1: set ROI, copy coordinate text and send to User 2
User 2: paste roi coordinates in edit text, press enter and save

  • Needs testing on non-system cameras.
  • Needs to disable crop setting button for traits that have it disabled.
Screen_recording_20250131_122857.mp4

Change Type

  • ADDITION (non-breaking change that adds functionality)
  • CHANGE (fix or feature that alters existing functionality)
  • FIX (non-breaking change that resolves an issue)
  • OTHER (use only for changes like tooling, build system, CI, docs, etc.)

Release Note



Release Type

For internal use - please leave these unchecked unless you are the one completing the merge.

  • MAJOR
  • MINOR
  • WAIT (No immediate release, but the changelog will be still be updated if there is a release note.)

added new color that defines inverted crop region color
updated list item image to fit center rather than crop
updated camerax to 1.4.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant