UNPKG

util-helpers

Version:

一个基于业务场景的工具方法库

15 lines (11 loc) 380 B
'use strict'; var getFileBlob = require('./getFileBlob.js'); var loadImage = require('./loadImage.js'); function loadImageWithBlob(img, ajaxOptions) { return getFileBlob(img, ajaxOptions).then(function (blob) { return loadImage(blob).then(function (image) { return { blob: blob, image: image }; }); }); } module.exports = loadImageWithBlob;