问题描述:
1. 使用attachmentSimple上传照片,当用手机直接拍照时,如果手机是竖着拍照,上传的照片显示出来就顺时针旋转了90度;如果手机是横着拍照,就没问题。
2. 在attachmentSimple组件上传图片的时候,即使设置compress=true,上传的文件也很大。如果我想将压缩比率再设置高一些,可以做到吗?
解决方案:
1. 使用uploader中的内容更新/UI2/system/components/justep/uploader;
2. 修改/UI2/system/components/justep/uploader/uploader-html5.js文件中的第6行,调整”800″成你期望的值
Uploader.prototype.getForm = function(file) {
var self = this;
var dtd = $.Deferred();
if(this.isImage(file.name) && file.compress != false && this.compress){
localResizeImage(file, {
width: 800,
fieldName: self.name
}).then(function(result){
var formData = result.formData;
dtd.resolve(self._getForm(file,formData));
}).catch(function(){
dtd.resolve(self._getForm(file));
});
}else{
dtd.resolve(this._getForm(file));
}
return dtd.promise();
};
3. 执行%JUSTEP_HOME%tools\dist\dist.bat
4. 重新生成app;
评一波