파일 처리 수정

main
이범준 10 months ago
parent a7e822ee37
commit 2cc5060d0c

@ -601,6 +601,10 @@ public class IntegrationSearchServiceBean extends AbstractServiceBean implements
String imagesFolderPath = outsourcingResultPath + File.separator + imagesFolderName; String imagesFolderPath = outsourcingResultPath + File.separator + imagesFolderName;
String metaFilePath = outsourcingResultPath + File.separator + metaFileName; String metaFilePath = outsourcingResultPath + File.separator + metaFileName;
File imagesFolderPathFile = new File(imagesFolderPath);
if (!imagesFolderPathFile.exists()) {
imagesFolderPathFile.mkdirs();
}
for(int i=0; i < dataObjectList.size(); i++) { for(int i=0; i < dataObjectList.size(); i++) {
DataObject dataObject = dataObjectList.get(i); DataObject dataObject = dataObjectList.get(i);
@ -618,6 +622,10 @@ public class IntegrationSearchServiceBean extends AbstractServiceBean implements
File orgnFile = new File(fileInfo.string("FILE_PATH")); File orgnFile = new File(fileInfo.string("FILE_PATH"));
if(!orgnFile.exists() || !orgnFile.canRead()) {
continue;
}
String modifiedFileName = "P"+fileInfo.string("INF_KEY")+CmmnUtil.indexToAlphabet(j, true)+"."+"JPG"; String modifiedFileName = "P"+fileInfo.string("INF_KEY")+CmmnUtil.indexToAlphabet(j, true)+"."+"JPG";
String modifiedFilePath = imagesFolderPath + File.separator + modifiedFileName; String modifiedFilePath = imagesFolderPath + File.separator + modifiedFileName;

@ -81,8 +81,13 @@ public class MediaBean extends AbstractComponent {
List<PstnAndSize> result = new ArrayList<>(); List<PstnAndSize> result = new ArrayList<>();
try { try {
File imageFile = new File(imagePath);
if(!imageFile.exists() || !imageFile.canRead()) {
result.add(new PstnAndSize(0, 0, 0, 0));
return result;
}
BufferedImage image = ImageIO.read(new File(imagePath)); BufferedImage image = ImageIO.read(imageFile);
float originalWidth = image.getWidth(null); float originalWidth = image.getWidth(null);
float originalHeight = image.getHeight(null); float originalHeight = image.getHeight(null);
float transX = pstnAndSize_in_print.getWidth() / originalWidth; float transX = pstnAndSize_in_print.getWidth() / originalWidth;

Loading…
Cancel
Save