Browse Source

PC端专家头像保存,大头像不做裁剪。

zzy.zhiyuan.foxmail 8 years ago
parent
commit
675fc68198
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/main/java/com/ekexiu/portal/service/ImageService.java

+ 2 - 2
src/main/java/com/ekexiu/portal/service/ImageService.java

307
		ByteArrayOutputStream os = new ByteArrayOutputStream();
307
		ByteArrayOutputStream os = new ByteArrayOutputStream();
308
		JpgUtil.cutByPerCent(new ByteArrayInputStream(src), os, x, y, w, h);
308
		JpgUtil.cutByPerCent(new ByteArrayInputStream(src), os, x, y, w, h);
309
		src = os.toByteArray();
309
		src = os.toByteArray();
310
		byte[] li = this.zoomImage(src, this.largeHeadPhotoWidth, this.largeHeadPhotoHeight);
310
//		byte[] li = this.zoomImage(src, this.largeHeadPhotoWidth, this.largeHeadPhotoHeight);
311
		byte[] mi = this.zoomImage(src, this.middleHeadPhotoWidth, this.middleHeadPhotoHeight);
311
		byte[] mi = this.zoomImage(src, this.middleHeadPhotoWidth, this.middleHeadPhotoHeight);
312
		byte[] si = this.zoomImage(src, this.smallHeadPhotoWidth, this.smallHeadPhotoHeight);
312
		byte[] si = this.zoomImage(src, this.smallHeadPhotoWidth, this.smallHeadPhotoHeight);
313
		IoUtil.saveStream(new FileOutputStream(new File(this.headPath, id + "_s.jpg")), si, true);
313
		IoUtil.saveStream(new FileOutputStream(new File(this.headPath, id + "_s.jpg")), si, true);
314
		IoUtil.saveStream(new FileOutputStream(new File(this.headPath, id + "_m.jpg")), mi, true);
314
		IoUtil.saveStream(new FileOutputStream(new File(this.headPath, id + "_m.jpg")), mi, true);
315
		IoUtil.saveStream(new FileOutputStream(new File(this.headPath, id + "_l.jpg")), li, true);
315
		IoUtil.saveStream(new FileOutputStream(new File(this.headPath, id + "_l.jpg")), src, true);
316
	}
316
	}
317
	
317
	
318
	@Post
318
	@Post