summaryrefslogtreecommitdiff
path: root/cmd/rescribe/gui.go
diff options
context:
space:
mode:
authorNick White <git@njw.name>2023-02-16 23:12:13 +0000
committerNick White <git@njw.name>2023-02-16 23:12:13 +0000
commit16e77ea6ae00b05cac436810c21577033facb504 (patch)
treec0b847ab4b45936262eeb3f98646536555334411 /cmd/rescribe/gui.go
parent59f87fbcbcc4d6c5ac165d6053c1a3734f48e810 (diff)
parent8c9fff155744b85ccf05725c88b9abf29cfe2564 (diff)
Merge branch 'master' into guirefactor
Diffstat (limited to 'cmd/rescribe/gui.go')
-rw-r--r--cmd/rescribe/gui.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/cmd/rescribe/gui.go b/cmd/rescribe/gui.go
index 91cdb4d..16e6bd8 100644
--- a/cmd/rescribe/gui.go
+++ b/cmd/rescribe/gui.go
@@ -376,7 +376,7 @@ func letsGo(ctx context.Context, log *log.Logger, cmd string, tessdir string, gb
// happens if extractPdfImgs recovers from a PDF panic,
// which will occur if we encounter an image we can't decode
if bookdir == "" {
- msg := fmt.Sprintf("Error opening PDF\nThe format of this PDF is not supported, extract the images to .jpg manually into a folder first.\n")
+ msg := fmt.Sprintf("Error opening PDF\nThe format of this PDF is not supported, extract the images to .jpg manually into a\nfolder first, using a tool like the PDF image extractor at https://pdfcandy.com/extract-images.html.\n")
dialog.ShowError(errors.New(msg), win)
fmt.Fprintf(os.Stderr, msg)
@@ -405,6 +405,9 @@ func letsGo(ctx context.Context, log *log.Logger, cmd string, tessdir string, gb
}
if err != nil {
msg := fmt.Sprintf("Error during processing: %v\n", err)
+ if strings.HasSuffix(err.Error(), "No images found") && strings.HasSuffix(dir.Text, ".pdf") && !f.IsDir() {
+ msg = fmt.Sprintf("Error opening PDF\nNo images found in the PDF. Most likely the format of this PDF is not supported,\nextract the images to .jpg manually into a folder first, using a tool like\nthe PDF image extractor at https://pdfcandy.com/extract-images.html.\n")
+ }
dialog.ShowError(errors.New(msg), win)
fmt.Fprintf(os.Stderr, msg)