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);