Firelands128 / photo_gallery

A Flutter plugin that retrieves images and videos from mobile native gallery.
BSD 3-Clause "New" or "Revised" License
68 stars 62 forks source link

Auto file extension #10

Closed tonycn closed 3 years ago

tonycn commented 4 years ago
Firelands128 commented 3 years ago

Thank you for the contribution!

This PR size is pretty big and includes so many improvements, but there are some unnecessary features in my opinion.

Adding raw and autoExtension parameter in getFile API is verbose. Because in Android, both are always true. In iOS, we can directly write the original data to a cache file, which means raw parameter is also always true. I will modify it later in a separate commit. Besides, autoExtension is not used in getFile function in Swift file, which means always use true value. So I think it's better not to add these two parameter to the API and implements them directly.

Adding clear API to clean the cache directory and adding mimeType attribute to Medium are good improvements. But it's better to create new PRs to add these features. Could you please extract them out to create new PRs and keep PR size to a minimum, which would be more convenient to merge PR?

Fix: Query mimeType in Android should also add MediaStore.Images.Media.MIME_TYPE in imageMetadataProjection in PhotoGalleryPlugin.kt line 57.

Adding assetUTI attribute to Medium is unnecessary because it's rarely used in APP and not available in Android.

Could you please improve your code and create new PRs? I will close this PR for now. Thanks for your contributions.