这是我的代码
var dbx = new Dropbox.Dropbox({ accessToken: 'xxxxxxxxxxxxxxxxxxxxxxxx' });
function renderItems(items) {
var filesContainer = document.getElementById('files');
items.forEach(function(item) {
dbx.filesGetThumbnail({ path: item.path_display }) // here we need to add size
.then(function(response) {
jQuery('#full__gallery__slider').append('<div class="item"><div class="gallery__box"><img src="'+window.URL.createObjectURL(response.fileBlob)+'" class="img-circle"></div></div>');
})
.catch(function(error) {
console.log(error);
});
});
}
dbx.filesListFolder({path: ''})
.then(function(response) {
renderItems(response.entries);
});
现在我得到像61X57的图像问题:我只想知道如何获取orignal图像
如果要检索原始图像数据,请改用the filesDownload
method。
filesGetThumbnail
专门用于检索调整大小的图像版本,但filesDownload
可用于检索任何类型文件的原始文件数据。
我实际上使用下面的代码来获取图像的大小
var img = document.getElementById('imageid');
var width = img.clientWidth;
var height = img.clientHeight;
但我不确定dropbox api ..我无法保证