打包成可执行jar。并删除无效的代码

master
zhanghai 2 years ago
parent 84b0adb168
commit 4629d196d4

@ -24,7 +24,7 @@ public class Document {
//写一个方法判断是 A3 还是 A4
public Boolean isA3() {
if (width > Integer.parseInt(Config.getParam("a3.width")) || longTh > Integer.parseInt(Config.getParam("a3.length"))) {
if (width/dpi*2.54 > Integer.parseInt(Config.getParam("a3.width")) || longTh/dpi*2.54 > Integer.parseInt(Config.getParam("a3.length"))) {
return true;
}
return false;

@ -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;
}

Loading…
Cancel
Save