minor fix: explicitly cast the sum to float, and remove unthrown exception.

This commit is contained in:
Balázs Szücs 2025-05-28 21:12:10 +02:00
parent afa0bb6d2d
commit 47976ee1ec

View File

@ -53,7 +53,7 @@ public class FakeScanController {
description = description =
"Applies various effects to make a PDF look like it was scanned, including rotation, noise, and edge softening. Input:PDF Output:PDF Type:SISO") "Applies various effects to make a PDF look like it was scanned, including rotation, noise, and edge softening. Input:PDF Output:PDF Type:SISO")
public ResponseEntity<byte[]> fakeScan(@Valid @ModelAttribute FakeScanRequest request) public ResponseEntity<byte[]> fakeScan(@Valid @ModelAttribute FakeScanRequest request)
throws IOException, InterruptedException { throws IOException {
MultipartFile file = request.getFileInput(); MultipartFile file = request.getFileInput();
// Apply preset first if needed // Apply preset first if needed
@ -350,7 +350,7 @@ public class FakeScanController {
// Normalize kernel // Normalize kernel
for (int i = 0; i < data.length; i++) { for (int i = 0; i < data.length; i++) {
data[i] /= sum; data[i] /= (float) sum;
} }
// Create and apply convolution // Create and apply convolution