Skip to content

Commit

Permalink
Resolves RPTools#483
Browse files Browse the repository at this point in the history
  • Loading branch information
Jmr3366 committed Oct 11, 2024
1 parent cbcf135 commit dd44a05
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,9 @@ public Object childEvaluate(
FunctionUtil.checkNumberParam(functionName, args, 2, 2);
String imageName = args.get(0).toString();
String imageString = args.get(1).toString();
if (imageName.isEmpty() || imageString.isEmpty()) {
if (imageName.isEmpty() || imageString.isEmpty()) {
throw new ParserException(
I18N.getText("macro.function.general.paramCannotBeEmpty", functionName));
I18N.getText("macro.function.general.paramCannotBeEmpty", functionName));
} else if (imageString.length() > 8) {
byte[] imageBytes = Base64.decode(imageString);
String imageCheck;
Expand All @@ -193,8 +193,8 @@ public Object childEvaluate(
throw new ParserException(I18N.getText("dragdrop.unsupportedType", functionName));
}
if (imageCheck.equals(FILE_HEADER_WEBP)
|| imageCheck.equals(FILE_HEADER_JPG)
|| imageCheck.equals(FILE_HEADER_PNG)) {
|| imageCheck.equals(FILE_HEADER_JPG)
|| imageCheck.equals(FILE_HEADER_PNG)) {
Asset asset = Asset.createImageAsset(imageName, imageBytes);
AssetManager.putAsset(asset);
assetId.append(asset.getMD5Key().toString());
Expand All @@ -204,7 +204,7 @@ public Object childEvaluate(
}
} else {
throw new ParserException(
I18N.getText("macro.function.general.wrongParamType", functionName));
I18N.getText("macro.function.general.wrongParamType", functionName));
}
}

Expand Down Expand Up @@ -363,4 +363,4 @@ private static Token findImageToken(final String name, String functionName) {
// throw new ParserException(I18N.getText("macro.function.general.unknownToken", functionName,
// name));
}
}
}

0 comments on commit dd44a05

Please sign in to comment.