@@ -151,22 +151,6 @@ public class ImageFoundRequestHandler implements RequestHandler {
|
|||||||
Path tempFile = null;
|
Path tempFile = null;
|
||||||
try {
|
try {
|
||||||
tempFile = fileUploadService.downloadImageFromUrl(url);
|
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();
|
String filePath = tempFile.toAbsolutePath().toString();
|
||||||
|
|
||||||
|
|||||||
@@ -47,6 +47,16 @@ public class ImageHashService {
|
|||||||
public Map<String, Long> calculateHash(Path imagePath) throws IOException {
|
public Map<String, Long> calculateHash(Path imagePath) throws IOException {
|
||||||
PHash pHash;
|
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()) {
|
if (imagePath.toFile().exists()) {
|
||||||
pHash = PerceptualHashHelper.INSTANCE.generateDCTPerceptualHash(imagePath.toFile());
|
pHash = PerceptualHashHelper.INSTANCE.generateDCTPerceptualHash(imagePath.toFile());
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user