imagepicker

package
v0.11.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 2, 2026 License: MIT Imports: 2 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package imagepicker lets the user choose photos and videos from their library, or take one with the camera, on phones and tablets: the system's own pickers (PHPickerViewController and UIImagePickerController on iOS, the Photo Picker and the camera app on Android), which ask the user for no permission to read the library. Elsewhere its functions report errors.ErrUnsupported.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Capture

func Capture(ctx context.Context) (string, error)

Capture shows the camera, for a photo, and returns the path of a JPEG of it in the app's temporary directory, "" when the user went back.

func Pick

func Pick(ctx context.Context, o Options) ([]string, error)

Pick shows the system's picker of the user's library, and returns the paths of copies of what they chose in the app's temporary directory: none when they went back. Call it off the main goroutine, as it waits for the user.

Types

type Kind

type Kind string

Kind is what a picker shows.

const (
	Images Kind = "images"
	Videos Kind = "videos"
	// Any shows both.
	Any Kind = "any"
)

type Options

type Options struct {
	// Kind is what it shows: Images by default.
	Kind Kind
	// Limit is how many the user may choose: 1 by default, 0 meaning 1, and
	// negative as many as they like.
	Limit int
}

Options are what Pick lets the user choose.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL