From 251355f8f6bc397e67ce28b66164759789aa6750 Mon Sep 17 00:00:00 2001 From: Nick White Date: Mon, 13 Feb 2023 11:06:52 +0000 Subject: rescribe: Improve error messages in cases of PDF image extraction failure --- cmd/rescribe/gui.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'cmd/rescribe') 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) -- cgit v1.2.1-24-ge1ad From 03977b5651cc4ae60b854f772e006f73f7a0b311 Mon Sep 17 00:00:00 2001 From: Nick White Date: Mon, 13 Feb 2023 13:51:28 +0000 Subject: rescribe: enable wayland in flatpak now fyne has good support --- cmd/rescribe/xyz.rescribe.rescribe.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'cmd/rescribe') diff --git a/cmd/rescribe/xyz.rescribe.rescribe.yml b/cmd/rescribe/xyz.rescribe.rescribe.yml index 17db7c8..575b0fe 100644 --- a/cmd/rescribe/xyz.rescribe.rescribe.yml +++ b/cmd/rescribe/xyz.rescribe.rescribe.yml @@ -6,9 +6,9 @@ sdk-extensions: org.freedesktop.Sdk.Extension.golang build-options: append-path: /usr/lib/sdk/golang/bin finish-args: - - --socket=x11 + - --socket=fallback-x11 - --share=ipc # needed for X11 - #- --socket=wayland # wayland is not stable on fyne yet, when it is add this and the wayland tag to 'go build' + - --socket=wayland - --device=dri # OpenGL - --share=network # Used for google book downloading - --filesystem=home @@ -17,7 +17,7 @@ modules: - name: rescribe buildsystem: simple build-commands: - - cd cmd/rescribe && go build . + - cd cmd/rescribe && go build -tags wayland . - install -Dm00755 cmd/rescribe/rescribe $FLATPAK_DEST/bin/rescribe-bin - install -Dm00644 cmd/rescribe/icon.256.png $FLATPAK_DEST/share/icons/hicolor/256x256/apps/xyz.rescribe.rescribe.png - install -Dm00644 cmd/rescribe/xyz.rescribe.rescribe.desktop $FLATPAK_DEST/share/applications/xyz.rescribe.rescribe.desktop -- cgit v1.2.1-24-ge1ad From 3dd003691436ed954d3b7de54affbb10b509d5a6 Mon Sep 17 00:00:00 2001 From: Nick White Date: Mon, 13 Feb 2023 17:48:16 +0000 Subject: Release 1.1.0 --- cmd/rescribe/xyz.rescribe.rescribe.appdata.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cmd/rescribe') diff --git a/cmd/rescribe/xyz.rescribe.rescribe.appdata.xml b/cmd/rescribe/xyz.rescribe.rescribe.appdata.xml index a6f17b1..0deae17 100644 --- a/cmd/rescribe/xyz.rescribe.rescribe.appdata.xml +++ b/cmd/rescribe/xyz.rescribe.rescribe.appdata.xml @@ -22,9 +22,9 @@ - + -

Improved PDF reading by adding support for embedded CCITT images. Improve PDF parsing to prevent a possible crash with bad PDF files.

+

Improved PDF reading by adding support for embedded CCITT images. Improved PDF parsing to prevent a possible crash with bad PDF files. Improved error messages for unreadable PDFs. Improved GUI theme thanks to an update to Fyne.

-- cgit v1.2.1-24-ge1ad From 8337e1d01680a603243893092a07f77e45cace24 Mon Sep 17 00:00:00 2001 From: Nick White Date: Mon, 13 Feb 2023 21:25:45 +0000 Subject: Update flatpak to new version --- cmd/rescribe/xyz.rescribe.rescribe.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'cmd/rescribe') diff --git a/cmd/rescribe/xyz.rescribe.rescribe.yml b/cmd/rescribe/xyz.rescribe.rescribe.yml index 575b0fe..16535dc 100644 --- a/cmd/rescribe/xyz.rescribe.rescribe.yml +++ b/cmd/rescribe/xyz.rescribe.rescribe.yml @@ -29,11 +29,11 @@ modules: sources: - type: git url: https://github.com/rescribe/bookpipeline - tag: v1.0.2 - commit: 3fb28b552eb1e945ff8ba48dd96271e641c295bc + tag: v1.1.0 + commit: 3dd003691436ed954d3b7de54affbb10b509d5a6 - type: archive - url: https://rescribe.xyz/rescribe/modules-20221030-3a6024.tar.xz - sha256: 98fdbe455f7cb916cda570d0a30fca0de331809d4549e655e25b95e9be119856 + url: https://rescribe.xyz/rescribe/modules-20230213-3dd003.tar.xz + sha256: 36553c4b97ceefc2c4711d18f26c98d89a9a610cb99bd2a38b7a0bbf3236eb4a strip-components: 0 - type: archive url: https://rescribe.xyz/rescribe/embeds/tessdata.20220322.zip -- cgit v1.2.1-24-ge1ad From b73eb9816be9f3ce7fc89ef4ba24aa984ff14dd2 Mon Sep 17 00:00:00 2001 From: Nick White Date: Tue, 14 Feb 2023 14:40:14 +0000 Subject: Update flatpak build to choose wayland version if in wayland environment --- cmd/rescribe/xyz.rescribe.rescribe.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'cmd/rescribe') diff --git a/cmd/rescribe/xyz.rescribe.rescribe.yml b/cmd/rescribe/xyz.rescribe.rescribe.yml index 16535dc..ae87d59 100644 --- a/cmd/rescribe/xyz.rescribe.rescribe.yml +++ b/cmd/rescribe/xyz.rescribe.rescribe.yml @@ -17,12 +17,14 @@ modules: - name: rescribe buildsystem: simple build-commands: - - cd cmd/rescribe && go build -tags wayland . + - cd cmd/rescribe && go build . + - cd cmd/rescribe && go build -tags wayland -o rescribe-wayland . - install -Dm00755 cmd/rescribe/rescribe $FLATPAK_DEST/bin/rescribe-bin + - install -Dm00755 cmd/rescribe/rescribe-wayland $FLATPAK_DEST/bin/rescribe-bin-wayland - install -Dm00644 cmd/rescribe/icon.256.png $FLATPAK_DEST/share/icons/hicolor/256x256/apps/xyz.rescribe.rescribe.png - install -Dm00644 cmd/rescribe/xyz.rescribe.rescribe.desktop $FLATPAK_DEST/share/applications/xyz.rescribe.rescribe.desktop - install -Dm00644 cmd/rescribe/xyz.rescribe.rescribe.appdata.xml $FLATPAK_DEST/share/appdata/xyz.rescribe.rescribe.appdata.xml - - printf '#!/bin/sh\nTMPDIR=$XDG_RUNTIME_DIR rescribe-bin -gbookcmd "/app/bin/getgbook" -tesscmd "/app/bin/tesseract" -t "/app/share/tessdata/rescribev9_fast.traineddata"\n' > $FLATPAK_DEST/bin/rescribe + - printf '#!/bin/sh\nexport TMPDIR=$XDG_RUNTIME_DIR\nbin=rescribe-bin\ntest -n "$WAYLAND_DISPLAY" && bin=rescribe-bin-wayland\n"$bin" -gbookcmd "/app/bin/getgbook" -tesscmd "/app/bin/tesseract" -t "/app/share/tessdata/rescribev9_fast.traineddata"\n' > $FLATPAK_DEST/bin/rescribe - chmod 755 $FLATPAK_DEST/bin/rescribe - mkdir -p $FLATPAK_DEST/share/tessdata - cp -r tessdata/* $FLATPAK_DEST/share/tessdata/ -- cgit v1.2.1-24-ge1ad From 8c9fff155744b85ccf05725c88b9abf29cfe2564 Mon Sep 17 00:00:00 2001 From: Nick White Date: Wed, 15 Feb 2023 22:45:32 +0000 Subject: rescribe: update screenshots in appdata --- cmd/rescribe/xyz.rescribe.rescribe.appdata.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'cmd/rescribe') diff --git a/cmd/rescribe/xyz.rescribe.rescribe.appdata.xml b/cmd/rescribe/xyz.rescribe.rescribe.appdata.xml index 0deae17..795b228 100644 --- a/cmd/rescribe/xyz.rescribe.rescribe.appdata.xml +++ b/cmd/rescribe/xyz.rescribe.rescribe.appdata.xml @@ -9,7 +9,8 @@

An easy-to-use desktop tool for OCR of images, PDFs and Google Books. It uses the Tesseract OCR engine, combined with modern and efficient preprocessing and analysis pipelines, to produce high quality output in plain text, hOCR and searchable PDF format. The tool has been built with a focus on OCR of historical printed works, but it includes modern language options and also works well on modern printed works.

- https://rescribe.xyz/rescribe/screenshot-02.png + https://rescribe.xyz/rescribe/screenshot-03.png + https://rescribe.xyz/rescribe/screenshot-04.png https://rescribe.xyz/rescribe -- cgit v1.2.1-24-ge1ad