Update app/core/src/main/java/stirling/software/SPDF/controller/api/security/WatermarkController.java

save handling of bound parameters

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Anton Arhipov 2025-10-29 13:33:52 +02:00 committed by GitHub
parent 56c88fba3b
commit a506fe43da
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -349,10 +349,15 @@ public class WatermarkController {
if (request.getBounds() != null && !request.getBounds().isEmpty()) {
String[] boundsParts = request.getBounds().split(",");
if (boundsParts.length == 4) {
try {
boundsX = Float.parseFloat(boundsParts[0].trim());
boundsY = Float.parseFloat(boundsParts[1].trim());
boundsWidth = Float.parseFloat(boundsParts[2].trim());
boundsHeight = Float.parseFloat(boundsParts[3].trim());
} catch (NumberFormatException e) {
log.error("Invalid bounds format: {}", request.getBounds(), e);
boundsX = boundsY = boundsWidth = boundsHeight = null;
}
}
}