Since the new version of jdk1.8 no longer supports JPEGCodec, an error is reported, and the method needs to be modified
1.——————————- ———————
JPEGImageDecoder jpegDecoder = JPEGCodec.createJPEGDecoder(is);
BufferedImage buffImg = jpegDecoder.decodeAsBufferedImage();
Replaced with the new method
BufferedImage buffImg=ImageIO.read (is);
2.——————————————– ———
JPEGImageEncoder en = JPEGCodec.createJPEGEncoder(os);
en.encode(buffImg); Replace with the
new method
ImageIO.write(buffImg, “jpeg”, os);
——- ——————-end—————————— –
If the start is also being given, the following description is not provided cache directory tomcat
1, the new temp directory in tomcat;
2, and a similar method, by ImageIO.setCacheDirectory (cacheDirectory); set any, present in the cache directory
3. ImageIO uses the cache directory by default, which can be set by ImageIO.setUseCache(false), change the cache strategy, do not use file directory cache, use memory
Similar Posts:
- Imageio: ‘ffmpeg-win32-v3.2.4.exe’ was not found on your computer; downloading it now.
- After modifying Tomcat’s server.xml, the Tomcat deployment project reported an error: removing observe files from server… Could not clean server
- Linux Install Tomcat Error: service tomcat does not support chkconfig
- Several common error reporting and startup problems of Tomcat
- IllegalArgumentException: port out of range
- HTTP Status 500 – Unable to compile class for JSP settlement program
- [Solved] Upload Files Request processing failed;nested exception is org.springframework.web.multipart.MultipartException:Failed to parse multipart servlet request;multipart/form-data request failed.(**No permission**)
- python from scipy.misc import imread:ImportError: cannot import name imread
- Tomcat10 Error: java.lang.NoClassDefFoundError: javax/servlet/ServletContextListener
- Sudo starts Tomcat and reports an error. There is no Java environment