|
|
|
@ -114,6 +114,12 @@ public class FenpanService {
|
|
|
|
|
File[] files = sourceFile.listFiles();
|
|
|
|
|
for (File file : files) {
|
|
|
|
|
//非图片模式,跳过。
|
|
|
|
|
if(!(file.getName().endsWith(".jpg") || file.getName().endsWith(".png")
|
|
|
|
|
|| file.getName().endsWith(".jpeg") || file.getName().endsWith(".tif")
|
|
|
|
|
|| file.getName().endsWith(".tiff"))){
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
ImageInfo imageInfo = Imaging.getImageInfo(file);
|
|
|
|
|
int height = imageInfo.getHeight();
|
|
|
|
@ -188,9 +194,9 @@ public class FenpanService {
|
|
|
|
|
Pieces pieces = new Pieces(FileTypeEnum.JPG, o.getParentFile().getAbsolutePath(), o.getParentFile().getName());
|
|
|
|
|
allDirectory.add(pieces);
|
|
|
|
|
} else {
|
|
|
|
|
FileUtils.delete(new File(o.getAbsolutePath()));
|
|
|
|
|
|
|
|
|
|
System.out.println("请删除无效的文件:" + o.getAbsolutePath());
|
|
|
|
|
throw new RuntimeException("请删除无效的文件:" + o.getAbsolutePath());
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|