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