allow custom parameters for cropping image
This commit is contained in:
+1
-1
@@ -5,7 +5,7 @@ plugins {
|
|||||||
}
|
}
|
||||||
|
|
||||||
group = "com.krrishg"
|
group = "com.krrishg"
|
||||||
version = "1.0.0"
|
version = "1.0.1"
|
||||||
archivesBaseName = "kimage"
|
archivesBaseName = "kimage"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -124,12 +124,7 @@ public class ImageService {
|
|||||||
return Base64.getEncoder().encodeToString(imageBytes);
|
return Base64.getEncoder().encodeToString(imageBytes);
|
||||||
}
|
}
|
||||||
|
|
||||||
public BufferedImage cropImage(String image) throws IOException {
|
public BufferedImage cropImage(String image, int startX, int startY, int width, int height) throws IOException {
|
||||||
int startX = 200;
|
|
||||||
int startY = 335;
|
|
||||||
int width = 570;
|
|
||||||
int height = 620;
|
|
||||||
|
|
||||||
BufferedImage originalImage = getImageFromBase64(image);
|
BufferedImage originalImage = getImageFromBase64(image);
|
||||||
|
|
||||||
width = Math.min(width, originalImage.getWidth() - startX);
|
width = Math.min(width, originalImage.getWidth() - startX);
|
||||||
|
|||||||
Reference in New Issue
Block a user