Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ exports.createImageData = function (array, width, height) {
}
}

exports.loadImage = function (src) {
exports.loadImage = function (src, options) {
return new Promise((resolve, reject) => {
const image = document.createElement('img')
const image = Object.assign(document.createElement('img'), options)

function cleanup () {
image.onload = null
Expand Down
2 changes: 1 addition & 1 deletion types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ export function createImageData(width: number, height: number): ImageData
* @param src URL, `data: ` URI or (Node.js only) a local file path or Buffer
* instance.
*/
export function loadImage(src: string|Buffer): Promise<Image>
export function loadImage(src: string|Buffer, options?: any): Promise<Image>

/**
* Registers a font that is not installed as a system font. This must be used
Expand Down