[gscan2pdf-announce] scantpaper v4.0.2 released
Brought to you by:
ra28145
|
From: Jeff <jf...@po...> - 2026-10-31 11:22:59
|
Changes compared to v4.0.1: * Fix a start-up warning for legacy boolean settings such as `post_save_hook` that gscan2pdf 2.x stored as an empty string for false. The value is now corrected and logged instead of being reported on every start, and the corrected `false` is written back on exit. * A scan batch that ends because the document feeder is empty is no longer logged as an error with a traceback. An empty feeder is the normal end of a batch, so it is now recorded at INFO level; genuine scan errors still log at ERROR with their traceback. * A saved PDF no longer silently re-encodes a lossless page image as JPEG during the PDF/A conversion. When the "Flate" option is used, or "G4" (or Automatic resolves a page to Group 4 or Flate), the image now stays Flate or Group 4 in the final file, on every supported OCRmyPDF version. A save whose pages are all JPEG keeps them as JPEG, so an already-lossy document is not inflated. * A posterised grayscale page - a scan whose pixels use only a few distinct intensity levels, such as a document with a half-tone or line-art picture - is now stored and saved losslessly. On import it is kept as PNG instead of being re-encoded to JPEG, and "Automatic" PDF compression writes it with lossless Flate rather than JPEG. JPEG's transform assumes smooth tone, so for these pages it both smeared the levels and produced a larger file; the same 8-level page now saves smaller and without loss. Genuinely continuous-tone grayscale and colour pages still use JPEG. * The misleading "None" option is gone from the PDF compression menu. It never produced uncompressed output: it resolved to exactly the same lossless Flate stream as the "Flate" option, so it promised something it did not deliver. A configuration that had selected it now loads as "Flate", keeping the same output with an honest label. * The OCR "Advanced Tesseract engine parameters" field now says what it wants: engine parameters in `name=value` form - the values of tesseract's `-c` option - not command-line options. A pasted option such as `--user-words` or `--dpi` is refused with the equivalent parameter named (`user_words_file`, `user_defined_dpi`), and a leading `-c` is accepted so a line copied from tesseract's documentation works. A `user_words_file` or `user_patterns_file` that does not exist or cannot be read is reported before OCR starts instead of failing silently, and the resolved paths that will be applied are written to the log. * The OCR settings now include a **Page segmentation mode** and an **OCR engine mode** selector, alongside the language. The segmentation mode tells tesseract how to lay out the page (Automatic, Single column, Single block, Single line, Single word, Single character, Sparse text, or Raw line), and the engine mode chooses the engine (Default, LSTM only, Legacy, or Combined). Both default to the previous behaviour and are stored with the other OCR options. Choosing an engine mode the installed language data cannot provide no longer fails with a misleading "invalid tessdata path"; the error names the engine mode instead. Because these two modes are set by the new controls, `tessedit_pageseg_mode` and `tessedit_ocr_engine_mode` are now rejected in the advanced field with a message pointing to the controls. * Fixed about dialog * The OCR options now include a **Tessdata directory** control, so a `tessdata_best`, `tessdata_fast`, or per-user language data set can be chosen without replacing the system models or exporting `TESSDATA_PREFIX` before launch. Leave it empty for the automatic directory; **Browse** picks a folder and **Default** clears the choice. The directory is resolved as the chosen path first, then `TESSDATA_PREFIX`, then the system default, and it must directly contain `.traineddata` files. A `TESSDATA_PREFIX` that names a broad parent such as `/usr/share` is now rejected with an explanatory error instead of making tesseract search the whole tree and hang while listing languages. Changing the directory rebuilds the language list and keeps the current language, marked "(not installed)" when the new directory lacks it. The selection is stored with the other OCR options. Tesseract 3's removed `m_data_sub_dir` parameter remains rejected. * The OCR **Advanced Tesseract engine parameters** field and the text- layer editor now let **Tab** move focus to the next control, so OK (or Scan) stays reachable without the mouse; **Ctrl+Tab** and **Ctrl+Shift+Tab** move focus forward and backward. A literal tab character is no longer entered in these fields. * The OCR dialog now returns to the height it had before the **Advanced Tesseract engine parameters** expander was opened when that expander is collapsed. The **Page Range** frame also keeps its natural height instead of stretching to fill surplus window height in any dialog that shows it. * Rows in the scan, Clean up and Preferences dialogs now keep the height their content needs when the window is taller than the page. The surplus appears as empty space below the last row instead of stretching a frame, a checkbox, or a label-and-control row. This keeps the scan **# Pages** and **Source document** frames, the rotation controls, the Clean up options and the Preferences **General options** page at their natural heights. * Dialog content no longer runs flush against the window edge, and rows are no longer packed together. GTK4 dropped the content-area inset that GTK3 derived from the theme, and a box's spacing now defaults to zero, so every dialog sets a consistent inset and spacing - including the ones opened from the Tools menu and the ones built directly on `Gtk.Dialog`. * Dialog action buttons no longer touch each other or the window edge. GTK3's theme supplied the action area's button spacing and border; GTK4's action area is a plain box with zero spacing, so the app now applies a consistent inset and gap to every dialog with separate action buttons, including file choosers. A message dialog keeps its joined button bar. * Clicking a word in the text or annotation layer now selects the word under the pointer on HiDPI displays and on pages whose horizontal and vertical resolutions differ. The click was mapped with an older transform than the one the layer is drawn with, so it could land on a neighbouring word or on the page, and a correction only began after clicking several times. * A PDF whose text layer mixes upright and rotated slices now saves every word at its own size, so searching a word highlights the word found rather than a large surrounding block. A single tall rotated slice used to widen the grouping tolerance for the whole flat layer, which merged upright words from different rows into one oversized line and made the renderer draw them at that line's scale. * The scan dialog now opens with every saved postprocessing setting. A saved alternate-rotation, image clean-up or user-defined-tool setting, a missing clean-up tool, or an empty user-defined-tool list no longer raises a `TypeError` while the dialog is being built. Applying Preferences after removing the last tool also leaves an open scan dialog usable. * Restoring an empty crashed session no longer fails on the first scan with an internal error. It opens as a usable empty document, and the imported page becomes its first undo step. Reopening a session whose latest action removed every page now stays empty instead of showing the deleted pages again; undo still brings them back. * Selecting a flatbed source now starts **# Pages** at one page instead of inheriting the ADF `All` default. An unbounded flatbed batch is only possible after choosing `All` explicitly, and the dialog warns that scanning continues until cancelled. * Cancelling a scan between pages no longer queues the next page. If the scanner does not respond to cancel, scantpaper reports the failure and rebuilds the device session for the next scan; a device still held by the operating system is reported as busy instead of leaving the application unable to scan. Available on Github: https://github.com/carygravel/scantpaper/releases/tag/v4.0.2 Or via the PPA: https://launchpad.net/~jeffreyratcliffe/+archive/ubuntu/ppa |