Skip to content

Conversation

@Cewdyn
Copy link

@Cewdyn Cewdyn commented Feb 18, 2016

Improved the PhotoController to now accept files selected via non-standard file browsers. Also added file extension verification for files selected this way.

This is for issue #486

Let me know what you guys think!

…n-standard file browsers. The app now also verifies the extensions of files selected this way.
@patrickcousins
Copy link
Collaborator

Will take a look at this tomorrow. Thanks!

String imagePath = imageUri.getPath();
//If the uri comes from the default document picker, we don't have to worry about the
// extension. Android will already have made sure it is an image.
if (!"com.android.providers.media.documents".equals(imageUri.getAuthority())) {
Copy link
Author

Choose a reason for hiding this comment

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

When I get the chance I need to check the minSdkVersion for the app. Previous to KitKat, this was "media/external/images/media"

Copy link
Collaborator

Choose a reason for hiding this comment

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

min sdk is ICS. Can you be sure this PR works for ICS and above?

Copy link
Author

Choose a reason for hiding this comment

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

Yessir o7

…to make sure the image picker works with older versions of android.
<string name="err_invalid_phone">Please enter a valid phone number</string>
<string name="err_address_blank">Please enter an address</string>
<string name="err_cant_load_photo">Unable to load photo</string>
<string name="err_cant_load_photo_bad_extension">Sorry\, we couldn\'t load your file because it isn\'t an image.</string>
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is better but it's possible to choose a valid image and get this error message. Can we just make it say "Sorry, unable to load you image"

@patrickcousins
Copy link
Collaborator

Overall this is good. Still not the proper way to handle lots of different image managers but this has better error handling than the code we have now. If you can fix that string, I think we're good to merge. Then hopefully someone can tackle the proper way of doing this with the media store/cursor.

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.

2 participants