|
|
|
@ -1,7 +1,6 @@
|
|
|
|
|
package com.docus.sw.souyin;
|
|
|
|
|
|
|
|
|
|
import com.alibaba.excel.EasyExcel;
|
|
|
|
|
import com.alibaba.excel.util.FileUtils;
|
|
|
|
|
import com.docus.sw.Config;
|
|
|
|
|
import com.docus.sw.fenpan.Document;
|
|
|
|
|
import com.docus.sw.fenpan.FileTypeEnum;
|
|
|
|
@ -68,6 +67,13 @@ public class SuoyinService {
|
|
|
|
|
List<Document> documentList = new ArrayList<>();
|
|
|
|
|
Pieces pieces = new Pieces(FileTypeEnum.JPG, piece.getAbsolutePath(), piece.getName());
|
|
|
|
|
for (File docfile : piece.listFiles()) {
|
|
|
|
|
|
|
|
|
|
//非图片模式,跳过。
|
|
|
|
|
if(!(docfile.getName().endsWith(".jpg") || docfile.getName().endsWith(".png")
|
|
|
|
|
|| docfile.getName().endsWith(".jpeg") || docfile.getName().endsWith(".tif")
|
|
|
|
|
|| docfile.getName().endsWith(".tiff"))){
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
try {
|
|
|
|
|
ImageInfo imageInfo = Imaging.getImageInfo(docfile);
|
|
|
|
|
int height = imageInfo.getHeight();
|
|
|
|
@ -292,9 +298,9 @@ public class SuoyinService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
FileUtils.delete(new File(o.getAbsolutePath()));
|
|
|
|
|
|
|
|
|
|
System.out.println("请删除无效的文件:" + o.getAbsolutePath());
|
|
|
|
|
throw new RuntimeException("请删除无效的文件:" + o.getAbsolutePath());
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|