summaryrefslogtreecommitdiff
path: root/cmd/rescribe
diff options
context:
space:
mode:
authorNick White <git@njw.name>2023-02-13 12:06:49 +0000
committerNick White <git@njw.name>2023-02-13 12:06:49 +0000
commite738358cea6d0a5693c801509830801935a77ec6 (patch)
tree2e9e9ce15a690d3c0bd170a1eda5dd32d4e62111 /cmd/rescribe
parente48d3cd4215edeb314f80fee4ebbbd528031a92a (diff)
parent251355f8f6bc397e67ce28b66164759789aa6750 (diff)
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'cmd/rescribe')
-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 ef58fce..f14f288 100644
--- a/cmd/rescribe/gui.go
+++ b/cmd/rescribe/gui.go
@@ -498,7 +498,7 @@ func startGui(log *log.Logger, cmd string, gbookcmd string, training string, tes
// 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), myWindow)
fmt.Fprintf(os.Stderr, msg)
@@ -528,6 +528,9 @@ func startGui(log *log.Logger, cmd string, gbookcmd string, training string, tes
}
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), myWindow)
fmt.Fprintf(os.Stderr, msg)