Skip to content

[image_picker][android] Non-bitmap images now return path instead of null #3590

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

Merged
merged 16 commits into from
Apr 14, 2023

Conversation

andreisas06
Copy link
Contributor

@andreisas06 andreisas06 commented Mar 30, 2023

Description

This PR now returns the path of unsupported files(non-bitmap images) instead of null. Now the user can decide himself what to do with the path of the unsupported image. Example file showcases how to display an error placeholder whenever an unsupported image type is selected.

Issues

Fixes flutter/flutter#88461

Pre-launch Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I read and followed the [relevant style guides] and ran the auto-formatter. (Unlike the flutter/flutter repo, the flutter/packages repo does use dart format.)
  • I signed the [CLA].
  • The title of the PR starts with the name of the package surrounded by square brackets, e.g. [shared_preferences]
  • I listed at least one issue that this PR fixes in the description above.
  • I updated pubspec.yaml with an appropriate new version according to the [pub versioning philosophy], or this PR is [exempt from version changes].
  • I updated CHANGELOG.md to add a description of the change, [following repository CHANGELOG style].
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is [test-exempt].
  • All existing and new tests are passing.

@andreisas06 andreisas06 requested a review from gmackall as a code owner March 30, 2023 09:47
@google-cla
Copy link

google-cla bot commented Mar 30, 2023

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@andreisas06 andreisas06 changed the title [image_picker] Filter unsupported mime types in built-in Photos and Files applications on Android [image_picker][android] Filter unsupported mime types in built-in Photos and Files applications on Android Mar 30, 2023
@gmackall
Copy link
Member

Thanks for the contribution! It looks like the tests you added currently are failing to run, if you can get that sorted then we can get this fully reviewed. Also ccing @tarrinneal for image picker related PR visibility.

@andreisas06 andreisas06 requested a review from tarrinneal as a code owner April 5, 2023 14:10
@andreisas06 andreisas06 changed the title [image_picker][android] Filter unsupported mime types in built-in Photos and Files applications on Android [image_picker][android] Non-bitmap images now return path instead of null Apr 5, 2023
Copy link
Contributor

@stuartmorgan-g stuartmorgan-g left a comment

Choose a reason for hiding this comment

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

LGTM with CHANGELOG nits! @gmackall or @tarrinneal could you do the secondary review?


* Example file showcases how to display an error placeholder whenever an unsupported image type is selected.
Copy link
Contributor

Choose a reason for hiding this comment

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

We generally describe the change with a verb. E.g., "Adds handling of unsupported image types to the example."


* Non-bitmap images return path instead of null.
Copy link
Contributor

Choose a reason for hiding this comment

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

"Fixes handling of non-bitmap image types."

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated the PR with the changes, thank you for the review 🙏🏻.

@stuartmorgan-g stuartmorgan-g added the autosubmit Merge PR when tree becomes green via auto submit App label Apr 14, 2023
@auto-submit auto-submit bot merged commit b09b74e into flutter:main Apr 14, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Apr 17, 2023
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Apr 17, 2023
flutter/packages@e4ec155...0277f2a

2023-04-16 engine-flutter-autoroll@skia.org Roll Flutter from 00171b0 to 50171bb (7 revisions) (flutter/packages#3723)
2023-04-15 engine-flutter-autoroll@skia.org Roll Flutter from f740544 to 00171b0 (17 revisions) (flutter/packages#3717)
2023-04-15 49699333+dependabot[bot]@users.noreply.github.com Bump github/codeql-action from 2.2.9 to 2.2.12 (flutter/packages#3711)
2023-04-15 49699333+dependabot[bot]@users.noreply.github.com Bump actions/checkout from 3.5.0 to 3.5.2 (flutter/packages#3710)
2023-04-14 stuartmorgan@google.com [path_provider] Fix Android lint warnings (flutter/packages#3706)
2023-04-14 10687576+bparrishMines@users.noreply.github.com [webview_flutter_android] [camera_android_camerax] Updates internal Java InstanceManager to only stop finalization callbacks when stopped (flutter/packages#3571)
2023-04-14 stuartmorgan@google.com [shared_preferences] Fix Android Java version issue (flutter/packages#3712)
2023-04-14 48185017+andreisas06@users.noreply.github.com [image_picker][android] Non-bitmap images now return path instead of null (flutter/packages#3590)
2023-04-14 engine-flutter-autoroll@skia.org Roll Flutter from be45eb2 to f740544 (24 revisions) (flutter/packages#3713)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC flutter-ecosystem@google.com,rmistry@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
nploi pushed a commit to nploi/packages that referenced this pull request Jul 16, 2023
…null (flutter#3590)

## Description
This PR now returns the path of unsupported files(non-bitmap images) instead of null. Now the user can decide himself what to do with the path of the unsupported image. Example file showcases how to display an error placeholder whenever an unsupported image type is selected.

## Issues

Fixes flutter/flutter#88461
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App p: image_picker platform-android
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[image_picker] pickImage returns null when .svg is selected on Android
4 participants