@@ -171,17 +171,14 @@ public class ImageFoundRequestHandler implements RequestHandler {
|
|||||||
|
|
||||||
// boolean hashesAreEqual = hashSearchApiFile.get("hi").equals(checkFileHash.getHash64Hi())
|
// boolean hashesAreEqual = hashSearchApiFile.get("hi").equals(checkFileHash.getHash64Hi())
|
||||||
// && hashSearchApiFile.get("low").equals(checkFileHash.getHash64Lo());
|
// && hashSearchApiFile.get("low").equals(checkFileHash.getHash64Lo());
|
||||||
switch (checkResult) {
|
if (checkResult instanceof ImageCheckResult.Success success) {
|
||||||
case ImageCheckResult.Success success -> {
|
double watermarkCorrelation = success.getWatermarkCorrelation();
|
||||||
double watermarkCorrelation = success.getWatermarkCorrelation();
|
log.info("watermarkCorrelation: " + watermarkCorrelation);
|
||||||
log.info("watermarkCorrelation: " + watermarkCorrelation);
|
|
||||||
|
|
||||||
if (watermarkCorrelation < 50.0) {
|
if (watermarkCorrelation < 50.0) {
|
||||||
return new BaseResponse(request.getMsgId(), MessageCode.SUCCESS.getCode(),
|
return new BaseResponse(request.getMsgId(), MessageCode.SUCCESS.getCode(),
|
||||||
"Not found similar pictures", new YandexSearchResponse());
|
"Not found similar pictures", new YandexSearchResponse());
|
||||||
}
|
|
||||||
}
|
}
|
||||||
default -> throw new IllegalStateException("Unexpected value: " + checkResult);
|
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
if (tempFile != null) {
|
if (tempFile != null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user