睿虎的博客

1.首先需要切换到要升级的环境下,这里我切换到mye

conda activate mye

2.然后升级python版本

conda update python

3.如果想降级,比如降级到3.8,就这样写:

conda install python=3.8

SpringBoot显示图片其实很简单,代码如下:

1
2
3
4
5
6
7
8
@RequestMapping("/getimage")
public void getimage(HttpServletResponse response) throws IOException{
BufferedImage image = ImageIO.read(Files.newInputStream(Paths.get("D:\\laiscdata\\1.png")));
response.setHeader("Cache-Control", "no-store,no-cache");
response.setContentType("image/jpeg");
ServletOutputStream out = response.getOutputStream();
ImageIO.write(image,"jpg",out);
}
0%