Documentation
¶
Overview ¶
Package medialibrary saves to and reads from the phone's photos.
nimbus native plugin add media-library
id, err := medialibrary.Save(ctx, medialibrary.Item{Name: "receipt.jpg", Type: "image/jpeg", Data: b})
if ok, _ := medialibrary.Request(ctx); ok {
recent, err := medialibrary.List(ctx, 20)
jpeg, err := medialibrary.Read(ctx, recent[0].ID, 800)
}
To let someone pick one picture, use the camera plugin's Pick: it needs no permission. This is for going through their photos yourself.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Asset ¶
type Asset struct {
ID string `json:"id"` // for Read
Video bool `json:"video"` // false for a photo
Width int `json:"width"` // in pixels
Height int `json:"height"` // in pixels
Created time.Time `json:"-"` // when it was taken
Time float64 `json:"time"` // the same, in seconds since 1970
}
Asset is something in their photos.
Click to show internal directories.
Click to hide internal directories.