Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

image_picker fixes: file suffix, permissions redirect, video resize #600

Merged
merged 5 commits into from
Jun 12, 2018
Merged

Conversation

wreppun
Copy link
Contributor

@wreppun wreppun commented Jun 5, 2018

This PR is for three bugs relating to image picker. I found the latter two when fixing the first. I'm happy to split this up if that's easier.

  • (android) image_picker saves both captured images and captured video with a .png extension. I'm not 100% sure that .jpg and .mp4 are correct -- I couldn't find an authoritative source -- but that's what most information seemed to point towards.
  • (android) if the initial request from an app is for either video capture or the video gallery, after permission is granted, image_picker redirects to image capture or the image gallery.
  • (android) image_picker attempts to resize video if any of the resize parameters (maxWidth, maxHeight) are provided

Copy link
Contributor

@mravn-google mravn-google left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution and the attention to quality!

}

private void handleChoosePictureResult(int resultCode, Intent data) {
private void handleChooseMediaResult(int resultCode, Intent data, boolean isResizable) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Please consider breaking this method and the ones below in two to avoid the boolean argument. E.g. handleChooseImageResult and handleChooseVideoResult. I'd rather suffer a few lines of repeated code between the image vs video cases than having multiple methods whose boolean argument reveal that each does two things.

It doesn't seem unlikely that the image vs video case might drift further apart in the future.

@mravn-google mravn-google self-assigned this Jun 7, 2018
@mit-mit
Copy link
Member

mit-mit commented Jun 10, 2018

Hi @wreppun, thanks for contributing; have you had a chance to consider the review feedback?

@wreppun
Copy link
Contributor Author

wreppun commented Jun 11, 2018

Hey, yes, thanks for the feedback. I don't mind breaking those up -- I should be able to look at this and turn something around on Tuesday.

Copy link
Contributor

@mravn-google mravn-google left a comment

Choose a reason for hiding this comment

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

LGTM

@mravn-google mravn-google merged commit 9e369ad into flutter:master Jun 12, 2018
@mravn-google
Copy link
Contributor

Published

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
4 participants