Java ImageIO IIOException: Unsupported image type?

后端 未结 4 442
我寻月下人不归
我寻月下人不归 2020-12-13 13:20

Working with images in Java for the first time and am getting some bizarro exceptions that aren\'t documented very well. Here\'s the line of code that is failing:



        
4条回答
  •  难免孤独
    2020-12-13 14:09

    To work with images in a specific format,you need to add the corresponding dependency, such as imageio-jpeg or imageio-tiff:

    
    com.twelvemonkeys.imageio
    imageio-jpeg
    3.3.2
    
    
    
    com.twelvemonkeys.imageio
    imageio-bmp
    3.3.2
    
    
    
    com.twelvemonkeys.imageio
    imageio-core
    3.3.2
    
    

    the built-in ImageIO Java API loads the plugins automatically at runtime.

提交回复
热议问题