Some image suffixes are jpg, but the actual format is not JPG, and the image bytes are downloaded by URL. Then, when reading with ImageIO, there is a case of returning null. In this case, you need to use Webp-imageio.jar. (Https://bitbucket.org/luciad/webp-imageio).
The author, after all, Daniel, given the use of information is too large, the text is very concise, resulting in my use, spend a lot of time groping. Now the summary steps are as follows:
1. Download the compiled executable file on the website: https://bitbucket.org/luciad/webp-imageio/downloads. Source files I have tried, but need to compile, in the Windows environment, compile various errors. (hehe ...) It's a little anxious to write code in Windows these days.
2. The executable file contains the library files for Webp-imageio.jar and the respective platforms.
3. It is recommended that you deploy Webp-imageio.jar to warehousing (install or deploy) through Maven and then introduce the jar into your project through the declarations in the Pom file.
4. Remember that the 2nd step also downloaded the library file, select the platform for the program to run the corresponding library files, copied to "Java.library.path".
PS: The way to find Java.libary.path: Logger.info (System.getproperty ("Java.library.path"));
5. At this point, using ImageIO to read the image of the byte stream, some strange format is supported, so it will not return empty.
Java Picture Related