mirror of
https://github.com/catdad-experiments/heic-convert
synced 2024-11-22 10:05:09 +00:00
updating readme with browser information
This commit is contained in:
parent
4bc385162a
commit
cef9b94645
14
README.md
14
README.md
@ -18,7 +18,7 @@
|
||||
npm install heic-convert
|
||||
```
|
||||
|
||||
## Usage
|
||||
## Usage in NodeJS
|
||||
|
||||
Convert the main image in a HEIC to JPEG
|
||||
|
||||
@ -83,6 +83,18 @@ The work to convert an image is done when calling `image.convert()`, so if you o
|
||||
|
||||
_Note that while the converter returns a Promise and is overall asynchronous, a lot of work is still done synchronously, so you should consider using a worker thread in order to not block the main thread in highly concurrent production environments._
|
||||
|
||||
## Usage in the browser
|
||||
|
||||
While the NodeJS version of `heic-convert` may be compiled for use in the browser with something like `webpack`, [not all build tools necessarily like to compile all modules well](https://github.com/catdad-experiments/heic-convert/issues/29). However, what further complicates things is that this module uses pure-javascript implementations of a jpeg and png encoder. But the browser has its own native encoders! Let's just use those.
|
||||
|
||||
When compiling a client-side project, use:
|
||||
|
||||
```javascript
|
||||
const convert = require('heic-convert/browser');
|
||||
```
|
||||
|
||||
This is currently only supported in the main thread. Support for workers may be added in the future, but if you need it sooner, please create an issue or even a PR!
|
||||
|
||||
## Related
|
||||
|
||||
* [heic-cli](https://github.com/catdad-experiments/heic-cli) - convert heic/heif images to jpeg or png from the command line
|
||||
|
Loading…
Reference in New Issue
Block a user