0
点赞
收藏
分享

微信扫一扫

使用Thumbnails进行图片压缩,报“No suitable ImageReader found for source data”异常处理。

先转一次byte数组  再处理

byte[] bigContent =file.getBytes();
                Thumbnails.of(new ByteArrayInputStream(bigContent)).scale(1f).outputQuality(0.3f).toFile(fileThu);
这里fileThu直接使用文件路径比较好



举报

相关推荐

0 条评论