ImageIO.read返回null

1、原因

ImageIO.read 不支持 WEBP格式

通过文本编辑器打开图片后看到图片格式
如:

 

 

 

2、引入  webp-imageio

 <!-- https://mvnrepository.com/artifact/com.github.gotson/webp-imageio -->
        <dependency>
            <groupId>com.github.gotson</groupId>
            <artifactId>webp-imageio</artifactId>
            <version>0.2.2</version>
        </dependency>

 

posted @ 2021-10-26 23:07  rubekid  阅读(539)  评论(0编辑  收藏  举报