上传图片质量问题,原图上传,500K变成130几K,8M的图片变成了4M
在iphone(ios 11.3)真机测试小程序上传时,选择原图上传,控制台查看图片信息tempFiles,发现size只有原图的一半大小,上传成功完成后,服务器上看也只有原图一半大小。为什么?选了原图上传还会自动压缩图片?500K变成130几K,8M的图片变成了4M.
chooseImage: function (e) { var that = this;
wx.chooseImage({ count:1, sizeType: ['original', 'compressed'], sourceType: ['album'],
console.log(res); ## 这里就可以看到选择的图片size已经被压缩掉一半了 var lefthand = that.data.lefthand, righthand = that.data.righthand, face = that.data.face; var files = []; switch (currentid){ case 'lefthand': lefthand = res.tempFilePaths[0]; break; case 'righthand': righthand = res.tempFilePaths[0]; break; case 'face': face = res.tempFilePaths[0]; break; } wx.getImageInfo({ src:lefthand, success:function(res){ console.log(res); } }); files.push(lefthand); files.push(righthand); files.push(face); that.setData({ files: files, lefthand: lefthand, righthand:righthand, face:face }); } })}, |
