How to crop image in java?
问题 I'm using java to crop image when upload file, I set value and to try to crop but is not get correct size of image as I expected This my code: ( updated ) private BufferedImage cropImageSquare(byte[] image) throws IOException { InputStream in = new ByteArrayInputStream(image); BufferedImage originalImage = ImageIO.read(in); System.out.println("Original Image Dimension: "+originalImage.getWidth()+"x"+originalImage.getHeight()); BufferedImage croppedImage = originalImage.getSubimage(300, 150,