-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[image_picker] Fixes an issue where videos could be wrongly picked with .jpg extension #2860
Conversation
a8b3edb
to
9cac534
Compare
This has been approved by all reviewers. If it could be merged it would be great to prevent constant rebasing 😄 Thanks! |
Could this PR be approved? Many thanks in advance |
I need this fix, and I have this problemI hope the author will update soon. Thank you |
I can confirm that running off the fork resolves the issue for me My pubspec.yaml declaration image_picker:
git:
url: https://github.com/miguelpruivo/plugins
ref: 9cac5347d9ab9d111a918a8154fb060565b1bf31
path: packages/image_picker/image_picker |
Thank you for your email, which solved my problem.
| |
张涛
|
|
[email protected]
|
签名由网易邮箱大师定制
On 08/6/2020 02:35,Venkat Dinavahi<[email protected]> wrote:
I can confirm that running off the fork resolves the issue for me
image_picker:
git:
url: https://github.com/miguelpruivo/pluginsref: 9cac5347d9ab9d111a918a8154fb060565b1bf31path: packages/image_picker/image_picker
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
I tried the way, but still it is giving me a .jpg |
@miguelpruivo You may want to add |
@pedromassango done! 🎉 |
Hi, @danielwalczak @awazgyawali @fdcgr Thanks for your reviews! As per our tree hygiene https://github.com/flutter/flutter/wiki/Tree-hygiene#how-to-review-code we avoid people without commit access to this repo approving changes during a review as this confuses authors into thinking the PR is ready to merge. (Regular reviews are much appreciated, just don't click the approve changes button) Very sorry for such a long wait 😢 I would love to merge this however due to the lack of unit tests and my lack of experience here are some questions:
I trust that it works because you have done this sort of thing before but we still need to make sure this doesn't break anything on a patch release version. (love your work on file_picker btw) |
@miguelpruivo, @PixelToast I found another approach to do this here: #2821, do you think this is something that can be collaborated upon, so we only have to merge one PR to fix two bugs? |
I agree that the fix for image extension issue is better handled here than on #2821. Maybe collaborate is the better idea to merge just one PR. |
@PixelToast hi, thank you for the input. Currently I’m off on vacations until next week. However, I’ll try to help you as much as I can.
Let me know if you need anything else. |
@PixelToast @miguelpruivo @pedromassango Hi! I prefer to have two PRs, one for the image resizing (GIF) and one for the correct/incorrect JPG extension handling. @ditman Let's get this PR ready for merge first and I can rebase #2821 after that. |
@ened sounds good to me! |
@miguelpruivo Thanks for the update, it's good to know you are still able to help. If full integration tests aren't feasible, just a unit test for getImageExtension should be fine. |
@PixelToast ok no problem. I’ll try to get it done as soon as I return home at the weekend. |
Tested with:
Videos are selected correctly with .mp4 extension. The picked file playback also works as expected. |
…th .jpg extension (#52419)
Done @pedromassango. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correctly fixes extension issue
This seems ready for review. Cc @cyanglaz |
Can this be reviewed and merged, it has been 5 days already. |
@frankyvij it has been 3 months, actually. 😅 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! This is great. We will need to add tests before we can land this.
any update for this pr? thanks |
any update ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i test it using latest stable flutter version. and its works fine
Any reason why it's not merged yet? |
This pull request is not suitable for automatic merging in its current state.
|
Can this be merged in? This seems to be a problem that has existed for a while |
@miguelpruivo do you still have plans to work on this? It seems that this PR only need tests as mentioned in #2860 (comment). |
@pedromassango I'm sorry but currently I'm out of time to work on that. I might implement it but with no ETA. |
I created a PR with a working Unit Test. #3685 |
Fixes an issue where videos could be wrongly picked with
.jpg
extension.Description
When picking videos on Android devices, it will return file names ended with
.jpg
extension, regardless of the file being actually a video. This requires a workaround implementation, such as opening a File descriptor on Flutter side and rename it to.mp4
again.The issue happens because some URI paths doesn't have an extension and it was being extracted just by splitting the file name from
.
and getting the last part, which make it not quite reliable for some scenarios. Right now, I've updated the source to retrieve the extension based on the URI content.As a note, this doesn't happen with all Android devices, but I can see it easily replicable with Samsung phones.
Related Issues
Fixes #52419
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]
). This will ensure a smooth and quick review process.///
).flutter analyze
) does not report any problems on my PR.Breaking Change
Does your PR require plugin users to manually update their apps to accommodate your change?