0
BMP图像是在这里:https://www.filepicker.io/api/file/fdsYv4NSaCGUefBAQmER图片转换失败位图图像
和代码重现故障:
var fpfile = { url: 'https://www.filepicker.io/api/file/fdsYv4NSaCGUefBAQmER', filename: 'customers.jpg', mimetype: 'image/jpeg', isWriteable: false, size: 629454}; console.log("Converting..."); /*an element where we can display the resulting image*/ var result = document.getElementById("convert-result"); filepicker.convert(fpfile, {width: 200, height: 200}, function(new_FPFile){ console.log(new_FPFile.url); result.src = new_FPFile.url; } );
不清楚是什么我做错了这里,任何帮助将是非常赞赏。
感谢
谢谢。有没有什么办法可以从filepicker js中排除位图,以便用户不要上传它们? – Spiros
您可以在filepicker.pick()调用的选项中指定要允许的特定mimetypes或扩展名,或者您可以检查返回的FPFile上的mimetype,并且其代码流的行为不同 – brettcvz
**那么为什么你不排除他们默认情况下?!?!** –