Methods
# loadImage(imageFile) → {Promise.<HTMLImageElement>}
Helper function to load an image from a URL or Blob.
Parameters:
Name | Type | Description |
---|---|---|
imageFile |
string
|
Blob
|
The URL or Blob of the image. |
A promise that resolves with the loaded image.
Promise.<HTMLImageElement>
# async thisImg(imageFile, options) → {Promise.<{buffer: Buffer, metadata: object}>}
Processes an image by resizing, optionally changing its color space, and converting it to the specified format.
This Node.js version uses the ImgFormatterNode to handle image processing.
Parameters:
Name | Type | Default | Description |
---|---|---|---|
imageFile |
string
|
Blob
|
The image file path or Blob. | |
options |
object
|
string
|
default64 | The options object containing width, height, channels, and format, or a string key for a preset. |
A promise that resolves with the processed image data.
Promise.<{buffer: Buffer, metadata: object}>