You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
10 lines
275 B
10 lines
275 B
1 year ago
|
export default function(input, init) {
|
||
|
return new Promise(function(resolve, reject) {
|
||
|
var image = new Image;
|
||
|
for (var key in init) image[key] = init[key];
|
||
|
image.onerror = reject;
|
||
|
image.onload = function() { resolve(image); };
|
||
|
image.src = input;
|
||
|
});
|
||
|
}
|