System.out.println("文件上传成功路径为"+imagePath);
try {
BufferedImage templateImage = ImageIO.read(new File(imagePath+"/"+filename));
int height = templateImage.getHeight();
int width = templateImage.getWidth();
float scale = 0.5f;
int doWithHeight = (int) (scale * height);
int dowithWidth = (int) (scale * width);
BufferedImage finalImage = new BufferedImage(dowithWidth, doWithHeight, BufferedImage.TYPE_INT_RGB);
finalImage.getGraphics().drawImage(templateImage.getScaledInstance(dowithWidth, doWithHeight, java.awt.Image.SCALE_SMOOTH), 0, 0, null);
FileOutputStream fileOutputStream = new FileOutputStream(imagesamll+"/"+filename);
ImageIO.write(finalImage,"jpeg",fileOutputStream);
} catch (IOException e) {
e.printStackTrace();
}