Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/justin-m-lacy/imagepicker
HTML javascript pick and load images.
https://github.com/justin-m-lacy/imagepicker
Last synced: 26 days ago
JSON representation
HTML javascript pick and load images.
- Host: GitHub
- URL: https://github.com/justin-m-lacy/imagepicker
- Owner: justin-m-lacy
- License: mit
- Created: 2018-12-28T10:05:55.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2018-12-29T03:55:07.000Z (almost 6 years ago)
- Last Synced: 2024-04-24T23:01:27.307Z (7 months ago)
- Language: JavaScript
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pickimages
HTML javascript for picking and loading images.
Focus is on versatile capabilities rather than a bare minimum image picker.Single or multiple image picks are supported.
ImagePicker can be instantiated with an existing HTML element, an options object,
or no parameters.```javascript
import ImagePicker from 'pickfiles';let picker = new ImagePicker( element, (picked)=>{
});
```
`ImagePicker.readAs` must be set to `'dataurl'` to allow default Image creation. This is the default.
The following events can be subscribed:
```javascriptlet picker = new ImagePicker();
picker.on( 'pick', (picked)=>{});
picker.on( 'abort', (picker)=>{});
// called once for each file loaded.
picker.on( 'load', (data)=>{});
// called after all files have loaded.
picker.on('loadend', (datas)=>{});// single image is ready.
picker.on('ready', (image)=>{});
// all picked images are ready.
picker.on('allready', (images)=>{});```