From 9042817d632b1336f3832ac005668a24df58d28c Mon Sep 17 00:00:00 2001 From: r-ca Date: Mon, 29 Jan 2024 05:45:10 +0900 Subject: [PATCH] WIP --- .../nem/lacerta/component/scanner/ScannerManagerActivity.java | 4 +++- .../one/nem/lacerta/processor/impl/DocumentProcessorImpl.java | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/component/scanner/src/main/java/one/nem/lacerta/component/scanner/ScannerManagerActivity.java b/component/scanner/src/main/java/one/nem/lacerta/component/scanner/ScannerManagerActivity.java index 5efd0652..ec7da90e 100644 --- a/component/scanner/src/main/java/one/nem/lacerta/component/scanner/ScannerManagerActivity.java +++ b/component/scanner/src/main/java/one/nem/lacerta/component/scanner/ScannerManagerActivity.java @@ -116,7 +116,7 @@ public class ScannerManagerActivity extends AppCompatActivity { for (String result : croppedImageResults) { croppedImages.add(BitmapFactory.decodeFile(result)); } - processResult(croppedImages); + updatePage(); return null; }, (errorMessage) -> { @@ -267,6 +267,8 @@ public class ScannerManagerActivity extends AppCompatActivity { document.getDocument(documentId).thenAccept((documentDetail) -> { DocumentProcessor documentProcessor = documentProcessorFactory.create(documentDetail); documentProcessor.updatePageAtIndex(croppedImages.get(0), index); + logger.debug(TAG, "documentProcessor.getPageCount(): " + documentProcessor.getPageCount() + + ", documentDetail.getPages().size(): " + documentDetail.getPages().size()); document.updateDocument(documentProcessor.getDocumentDetail()).join(); dialog.dismiss(); }); diff --git a/processor/src/main/java/one/nem/lacerta/processor/impl/DocumentProcessorImpl.java b/processor/src/main/java/one/nem/lacerta/processor/impl/DocumentProcessorImpl.java index 98ff774a..142a8e7b 100644 --- a/processor/src/main/java/one/nem/lacerta/processor/impl/DocumentProcessorImpl.java +++ b/processor/src/main/java/one/nem/lacerta/processor/impl/DocumentProcessorImpl.java @@ -133,6 +133,8 @@ public class DocumentProcessorImpl implements DocumentProcessor{ logger.debug("updatePageAtIndex", "called"); String filename = UUID.randomUUID().toString() + ".png"; // TODO-rca: 拡張子を動的にする + logger.debug("updatePageAtIndex", "filename1: " + filename); + try { this.fileManager.getNewInstance().createDirectoryIfNotExist(DEFAULT_SAVE_DIR).resolve(DEFAULT_SAVE_DIR).saveBitmap(bitmap, filename); } catch (Exception e) { @@ -142,6 +144,8 @@ public class DocumentProcessorImpl implements DocumentProcessor{ lacertaVcs.undo(); } + logger.debug("updatePageAtIndex", "filename: " + filename); + Page page = new Page(); page.setFileName(filename); page.setBitmap(bitmap);