allow custom parameters for cropping image

This commit is contained in:
krrishg
2023-12-01 14:24:44 +05:45
parent f23745c3ac
commit 6c966b6a8b
2 changed files with 2 additions and 7 deletions
+1 -1
View File
@@ -5,7 +5,7 @@ plugins {
}
group = "com.krrishg"
version = "1.0.0"
version = "1.0.1"
archivesBaseName = "kimage"
+1 -6
View File
@@ -124,12 +124,7 @@ public class ImageService {
return Base64.getEncoder().encodeToString(imageBytes);
}
public BufferedImage cropImage(String image) throws IOException {
int startX = 200;
int startY = 335;
int width = 570;
int height = 620;
public BufferedImage cropImage(String image, int startX, int startY, int width, int height) throws IOException {
BufferedImage originalImage = getImageFromBase64(image);
width = Math.min(width, originalImage.getWidth() - startX);