Return the img element or FileReader object to allow aborting the image load2ms ‣
var img = loadImage(blobGIF, function () {})
expect(img).to.be.an.instanceOf(Object)
expect(img.onload).to.be.a('function')
expect(img.onerror).to.be.a('function')
Load image url10ms ‣
expect(
loadImage(imageUrlGIF, function (img) {
expect(img.width).to.equal(80)
expect(img.height).to.equal(60)
done()
})
).to.be.ok
Load image blob3ms ‣
expect(
loadImage(blobGIF, function (img) {
expect(img.width).to.equal(80)
expect(img.height).to.equal(60)
done()
})
).to.be.ok