From 9686eb453fa29160baaee90972c44911f67f1d79 Mon Sep 17 00:00:00 2001 From: backdev-1 Date: Wed, 29 Apr 2026 18:01:47 +0700 Subject: [PATCH] dev add check similar --- .../nocopy/handler/ImageFoundRequestHandler.java | 16 ---------------- .../soune/nocopy/service/ImageHashService.java | 10 ++++++++++ 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/src/main/java/ru/soune/nocopy/handler/ImageFoundRequestHandler.java b/src/main/java/ru/soune/nocopy/handler/ImageFoundRequestHandler.java index ede886e..7b76a76 100644 --- a/src/main/java/ru/soune/nocopy/handler/ImageFoundRequestHandler.java +++ b/src/main/java/ru/soune/nocopy/handler/ImageFoundRequestHandler.java @@ -151,22 +151,6 @@ public class ImageFoundRequestHandler implements RequestHandler { Path tempFile = null; try { tempFile = fileUploadService.downloadImageFromUrl(url); - log.info("tempFile: " + tempFile.toAbsolutePath()); - log.info("tempFile: " + tempFile.toAbsolutePath()); - log.info("tempFile: " + tempFile.toAbsolutePath()); - log.info("tempFile: " + tempFile.toAbsolutePath()); - log.info("tempFile: " + tempFile.toAbsolutePath()); - log.info("tempFile: " + tempFile.toAbsolutePath()); - log.info("tempFile: " + tempFile.toAbsolutePath()); - log.info("tempFile: " + tempFile.toAbsolutePath()); - log.info("tempFile: " + tempFile.toAbsolutePath()); - log.info("tempFile: " + tempFile.toAbsolutePath()); - log.info("tempFile: " + tempFile.toAbsolutePath()); - log.info("tempFile: " + tempFile.toAbsolutePath()); - log.info("tempFile: " + tempFile.toAbsolutePath()); - log.info("tempFile: " + tempFile.toAbsolutePath()); - log.info("tempFile: " + tempFile.toAbsolutePath()); - log.info("tempFile: " + tempFile.toAbsolutePath()); String filePath = tempFile.toAbsolutePath().toString(); diff --git a/src/main/java/ru/soune/nocopy/service/ImageHashService.java b/src/main/java/ru/soune/nocopy/service/ImageHashService.java index 44d0b54..3b730f3 100644 --- a/src/main/java/ru/soune/nocopy/service/ImageHashService.java +++ b/src/main/java/ru/soune/nocopy/service/ImageHashService.java @@ -47,6 +47,16 @@ public class ImageHashService { public Map calculateHash(Path imagePath) throws IOException { PHash pHash; + System.out.println("=== CHECK FILE ==="); + System.out.println("imagePath: " + imagePath); + System.out.println("imagePath.toString(): " + imagePath.toString()); + System.out.println("absolute path: " + imagePath.toAbsolutePath()); + System.out.println("exists (Files): " + Files.exists(imagePath)); + System.out.println("exists (File): " + imagePath.toFile().exists()); + System.out.println("isRegularFile: " + Files.isRegularFile(imagePath)); + System.out.println("size: " + Files.size(imagePath)); + System.out.println("================="); + if (imagePath.toFile().exists()) { pHash = PerceptualHashHelper.INSTANCE.generateDCTPerceptualHash(imagePath.toFile()); } else {