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

Fix #5246: map icon in Upload Wizard indicating if location is included in the EXIF data #5343

Merged

Conversation

alvinylt
Copy link
Contributor

Description (required)

Regarding issue #5246, the idea is to have variants of the map icon (that enables the user to manually add the location for the image EXIF) in the Upload Wizard.

Similar to the suggestion in the issue's discussion thread, my idea is to have the map icon labelled with a red question mark if the location is not to be uploaded. On the other hand, if the location is included in the EXIF, the map icon is labelled with a green tick. See the icons below.

I used Inkscape to modify the SVG path data and transformed it back to the Android XML format. Just wonder if there are any more intuitive and clear icons than the currently proposed ones. If so, we can create and test them in the app.

In terms of the change in the map icon, I reckon that the location is included by default if the image is taken by the in-app camera. That's why there is concern that users may unintentionally share their location as mentioned in the issue thread. For this, we use inAppPictureLocation to determine which icon to display.

Another situation is when the user manually pinpoints a location. The map icon is then labelled with a green tick.

I'd be happy to have insights for:

  • Whether the icons with "?" and "✓" are intuitive enough, or if there are even better alternatives
    • Since the icon displayed in the upload wizard is pretty small, probably not include complex graphics
  • The SVG data in the XML (since the additional icon is generated by Inkscape)
  • If any, cases when the icon should be changed but I missed here

If the location removal feature in #5262 is available, then I guess this shall also be extended (i.e. changing the green tick back to a red question mark).

Tests performed (required)

To be completed after confirming details.

Screenshots (for UI changes only)

Original map icon
Map icon with a red question mark
Map icon with a green tick

alvinylt and others added 3 commits October 17, 2023 04:47
The existing map icon may not be intuitive enough to indicate
whether the location EXIF data will be included
The two new XML map icons are intended to indicate the status of
location sharing with the location data in the Upload Wizard
If an image is capture with the in-app camera, the location in the
image metadata by default
If so, the map icon in the Upload Wizard should be labelled with
a green tick during initialisation of its UploadMediaDetailFragment instance
If the user selects images from the device storage
to upload, the location EXIF data might originally not be included
The map icon is labelled with a red question mark
After pin-pointing the location manully, the map icon should be
labelled with a green tick instead
@nicolas-raoul
Copy link
Member

Would you mind posting fullscreen screenshots of the whole activity, in both dark mode and light mode?
Thanks a lot! 🙂

SVG path is invalid, resulting in failure to render the icons
Also imports are required for UploadMediaDetailFragment to
use Drawable objects and R objects
When an image is chosen from the album to the Upload Wizard,
its EXIF might contain location data. hasLocation() and fix of init()
in UploadMediaDetailFragment ensures that the map icon is shown
correctly
@alvinylt
Copy link
Contributor Author

Here we go:

Green tick in dark mode Red question mark in dark mode Green tick in light mode Red question mark in dark mode

Test performed on a physical Android 13 phone.

There were some SVG rendering problems with XML in the initial three commits. This has now been fixed.
Also fixed some package imports in UploadMediaDetailFragment.

@nicolas-raoul
Copy link
Member

Is this still a draft, or ready for merging?

@alvinylt alvinylt marked this pull request as ready for review October 17, 2023 05:40
Copy link
Member

@nicolas-raoul nicolas-raoul left a comment

Choose a reason for hiding this comment

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

I tested, it works great!
Asking for just a few minor changes then this can be merged, I think.

@alvinylt
Copy link
Contributor Author

alvinylt commented Oct 17, 2023

Is this still a draft, or ready for merging?

Ready for review now.

Asking for just a few minor changes then this can be merged, I think.

Surely I can do the refinement 👍🏼

Fix the comment about red and green labels for the map icon
Instead of using printStackTrace(), error directed to logcat
Copy link
Member

@nicolas-raoul nicolas-raoul left a comment

Choose a reason for hiding this comment

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

Please use this as an example for logging:

Timber.d("Current image quality is %d", currentImageQuality);

Clean up the catch clause in hasLocation() and getDataTimeFromExif()
@alvinylt
Copy link
Contributor Author

Please use this as an example for logging:

Timber.d("Current image quality is %d", currentImageQuality);

Resolved.

@nicolas-raoul nicolas-raoul merged commit f7164d0 into commons-app:main Oct 18, 2023
1 check passed
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.

None yet

2 participants