From f76b61ce41ce63ccd8847c2c631f52ef74c60c2b Mon Sep 17 00:00:00 2001 From: Steve Hannah Date: Sat, 27 Apr 2024 07:05:47 -0700 Subject: [PATCH] fixed scaling on capturePhoto on android --- CodenameOne/src/com/codename1/capture/Capture.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CodenameOne/src/com/codename1/capture/Capture.java b/CodenameOne/src/com/codename1/capture/Capture.java index 64aa4c33ef..33c7f0c075 100644 --- a/CodenameOne/src/com/codename1/capture/Capture.java +++ b/CodenameOne/src/com/codename1/capture/Capture.java @@ -274,7 +274,7 @@ public void run() { if(scale != null) { try { - String path = url.substring(0, url.indexOf(".")) + "s" + url.substring(url.indexOf(".")); + String path = url.substring(0, url.lastIndexOf(".")) + "s" + url.substring(url.lastIndexOf(".")); OutputStream os = FileSystemStorage.getInstance().openOutputStream(path); scale.save(url, os, ImageIO.FORMAT_JPEG, targetWidth, targetHeight, 1); Util.cleanup(os);