图片处理依赖

		 <dependency>
	      <groupId>net.coobird</groupId>
	      <artifactId>thumbnailator</artifactId>
	      <version>0.4.8</version>
	    </dependency>

  

		ByteArrayOutputStream baos = new ByteArrayOutputStream();
		Thumbnails.of(new ByteArrayInputStream(bytes)).size(1, 1).keepAspectRatio(false).toOutputStream(baos);
		byte[] array = baos.toByteArray();

  

posted @ 2017-03-20 11:36  吐槽村  阅读(222)  评论(0编辑  收藏  举报