LynxImagePicker
Lets someone pick a photo with the phone's photo picker and hands it back as a Blob. import { LynxImagePicker, ImagePickerError, type ImagePickerOptions, type ImagePickerErrorCode, type PickedImage } from '@blotch/angular-lynx';
Pick a Photo shows it in use.
Usage
API
LynxImagePicker
Uses PHPickerViewController on iOS, the Photo Picker on Android, and an <input type="file" accept="image/*"> in the web preview. Only the apps --platform builds, with ng build or ng serve, have the native module behind it; elsewhere, such as Lynx Explorer and unit tests, pick() rejects with unavailable.
LynxImagePicker.pick()
Opens the picker and resolves with the photo picked, or with null when the person closes the picker without choosing. Rejects with an ImagePickerError, or with a RangeError for an option out of range. One picker can be open at a time: on iOS and Android, picking again while one is open rejects with failed; in the web preview, it resolves the open pick with null.
ImagePickerOptions
Either option re-encodes the photo as a JPEG: upright, whichever way the camera stored it, without the original's metadata, and with a white background where it was transparent. Without them, a JPEG, PNG, GIF or WebP comes back as it was picked, and any other format, such as HEIC, is re-encoded as a JPEG at full size.
