目前整个项目后台是javaSSM框架,前端利用plupload进行图片上传、上传服务器前会进预览显示
代码如下:利用mOxie对象进行预览,上传小图片时预览没有任何问题,但是当一次性上添加多张10M左右图片时,其中几张会预览出来,然后接着网页就会崩溃了,,求帮忙
![](https://profile-avatar.csdnimg.cn/5f88b495073a408e9317399419b02083_ai_bao_zi.jpg!4)
Plupload 前端预览大图片导致网页崩溃
- 写回答
- 好问题 0 提建议
- 追加酬金
- 关注问题
- 邀请回答
-
3条回答 默认 最新
- threenewbee 2018-01-05 10:28关注
10M的图片也太大了一点,一般数码相机、手机拍摄的也就几兆。
http://www.plupload.com/docs/v2/Image-Resizing-on-Client-Side
官方文档说了Obviously client-side and specifically browser environment cannot be as powerful (not yet at least) as the server-side might be. So somewhere there must be a limitation on the resolution that might be handled in the browsers or their add-ons. We assume it to be 6500 by 6500 pixels (about 42MP). I say assume, because there's no way to figure out the actual top line or detect when browser (or its add-on) runs out of memory - if this happens it simply hangs (the best case). So we came up with the safe margin, where browser can still reliably operate (read - breathe) and if either side of the image is larger than that margin, Plupload will simply bail out and upload the image as is, without any tampering.
最大不超过6500x6500像素,否则会内存溢出。
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报
悬赏问题
- ¥15 metadata提取的PDF元数据,如何转换为一个Excel
- ¥15 关于arduino编程toCharArray()函数的使用
- ¥100 vc++混合CEF采用CLR方式编译报错
- ¥15 coze 的插件输入飞书多维表格 app_token 后一直显示错误,如何解决?
- ¥15 vite+vue3+plyr播放本地public文件夹下视频无法加载
- ¥15 c#逐行读取txt文本,但是每一行里面数据之间空格数量不同
- ¥50 如何openEuler 22.03上安装配置drbd
- ¥20 ING91680C BLE5.3 芯片怎么实现串口收发数据
- ¥15 无线连接树莓派,无法执行update,如何解决?(相关搜索:软件下载)
- ¥15 Windows11, backspace, enter, space键失灵