|
|
@@ -28,7 +28,6 @@ public class ImageController {
|
|
|
if (url != null) {
|
|
|
return DownloadBytes.downloadAsBytesArray(url);
|
|
|
} else if (file != null) {
|
|
|
- log.info("File size: {} Name: {}", file.getSize(), file.getOriginalFilename());
|
|
|
return file.getBytes();
|
|
|
} else {
|
|
|
throw new RuntimeException("缺少file或url");
|
|
|
@@ -42,6 +41,7 @@ public class ImageController {
|
|
|
@RequestParam("pool") int pool) throws IOException {
|
|
|
float[] floats = new float[8];
|
|
|
service.calculatePHash(this.getFileBytes(file, url), floats);
|
|
|
+ log.info("size:",floats);
|
|
|
float[] binaries = new float[64];
|
|
|
service.transformBinaryArray(floats, binaries);
|
|
|
String hash = service.getReadableHash(floats);
|