Skip to content
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

Custom extensions on PickerType.Image #163

Open
HansHolz09 opened this issue Dec 3, 2024 · 3 comments
Open

Custom extensions on PickerType.Image #163

HansHolz09 opened this issue Dec 3, 2024 · 3 comments
Labels
next Scheduled for the next version

Comments

@HansHolz09
Copy link

Is there currently or will there be an option to select a specific photo/video format, such as only png or mp4, when using PickerType.Image/Video/ImageAndVideo, so that the photo selection on Android is the same and not this File-Picker?

@vinceglb
Copy link
Owner

vinceglb commented Dec 3, 2024

It's possible to specify the file extension in PickerType.File(). Here is an example:

val file = FileKit.pickFile(
    type = PickerType.File(extensions = listOf("png", "webp")),
)

// OR

val filePicker = rememberFilePickerLauncher(
    type = PickerType.File(listOf("png", "webp")),
) { file ->
    // Only png or webp files are allowed here
}

But currently, there is no option to specify the allowed extensions when using PickerType.Image/Video/ImageAndVideo. I searched if it can be done:

  • On Android, it seems possible because we can specify a custom MIME type: (doc here)
  • On iOS, I didn't find a way to filter out only specific types of images and videos.

We could probably add this option on Android only?

@HansHolz09
Copy link
Author

Thank you for your quick reply, it would be great if we could at least implement the feature for Android. For iOS we could simply use the normal file picker.

@vinceglb vinceglb added the next Scheduled for the next version label Dec 3, 2024
@vinceglb
Copy link
Owner

vinceglb commented Dec 3, 2024

Noted! We'll add the feature on Android if possible!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
next Scheduled for the next version
Projects
None yet
Development

No branches or pull requests

2 participants