This commit is contained in:
r-ca 2024-01-29 05:45:10 +09:00
parent 426a3534c8
commit 9042817d63
No known key found for this signature in database
GPG Key ID: 6A72911AC73464A9
2 changed files with 7 additions and 1 deletions

View File

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

View File

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