diff --git a/src/main/java/com/github/kokorin/jaffree/util/ParseUtil.java b/src/main/java/com/github/kokorin/jaffree/util/ParseUtil.java index 5704b153..dbda3d94 100644 --- a/src/main/java/com/github/kokorin/jaffree/util/ParseUtil.java +++ b/src/main/java/com/github/kokorin/jaffree/util/ParseUtil.java @@ -105,9 +105,10 @@ public static Long parseSizeInKiloBytes(final String value) { return null; } - final Matcher matcher = KBYTES_SUFFIX_PATTERN.matcher(value); + final String trimmedValue = value.trim(); + final Matcher matcher = KBYTES_SUFFIX_PATTERN.matcher(trimmedValue); - return matcher.find() ? parseLongWithSuffix(value.trim(), matcher.group(1)) : null; + return matcher.find() ? parseLongWithSuffix(trimmedValue, matcher.group(1)) : null; } /**