picked

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: Apache-2.0 Imports: 13 Imported by: 0 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 picked prepares the images a user picked as a PickRequest asks, in pure Go, for the backends whose pickers hand over files as they are: Windows and Linux. It reads each file's type and size, applies a JPEG's EXIF orientation, scales what is larger than the request's MaxDimension and encodes again what needs it, as NSH's pickers do; Apple platforms, Android and the web do the same with their own codecs. It also encodes the photos Windows and Linux take from their cameras' frames (Photo).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Photo

func Photo(r driver.PickRequest, pix []byte, width, height, stride int) (driver.PickedFile, error)

Photo encodes a camera frame of BGRA pixels, stride bytes a row, as the JPEG photo r asks for: scaled to its MaxDimension and at its quality. Windows and Linux take photos as frames of the preview their code scanners show.

func Prepare

func Prepare(r driver.PickRequest, files []driver.PickedFile) []driver.PickedFile

Prepare returns files as r asks for them: at most r.Limit, each with its type, its size as it shows and its bytes encoded again when r needs it. A file that does not decode when it must be encoded again is kept as it is.

func ReadFiles

func ReadFiles(r driver.PickRequest, paths []string) []driver.PickedFile

ReadFiles reads the files at paths as picked files, at most r.Limit, leaving out those that cannot be read, and prepares them.

Types

This section is empty.

Jump to

Keyboard shortcuts

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