add small clean up method

This commit is contained in:
2025-04-23 08:06:03 +02:00
parent ba8a9023ea
commit 494d26c712
3 changed files with 63 additions and 3 deletions

View File

@@ -32,6 +32,7 @@ func main() {
//{pb.FileType_IMAGE, "testdata/image-sample.png"},
{pb.FileType_PDF, "testdata/pdf-sample.pdf"},
{pb.FileType_PDF, "testdata/blitzer.pdf"},
{pb.FileType_PDF, "testdata/persopin.pdf"},
//{pb.FileType_VIDEO, "testdata/video-sample.webm"}
}
@@ -105,7 +106,7 @@ func createOCR(filePath string, ftype pb.FileType, client pb.ThumbnailServiceCli
return
}
fmt.Printf("[OCR] %s: %s\n %s", filePath, resp.Message, resp.TextContent)
fmt.Printf("[OCR] %s: %s\n %s, %dkb\n", filePath, resp.Message, resp.TextContent, len(resp.TextContent)/1024.0)
if len(resp.OcrContent) > 0 {
err := saveToFile([]byte(resp.OcrContent), filePath, "ocr", ".pdf")