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.