Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.fr.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ Il ne se connecte à Internet que :

- pour demander à GitHub (`api.github.com`) si une nouvelle version existe, peu après le démarrage puis toutes les quelques heures.
Désactivez-le dans Paramètres → À propos (« Rechercher automatiquement les mises à jour »).
- pour télécharger les moteurs de conversion que vous choisissez d'installer, depuis les emplacements officiels fixés dans [`engines.json`](src/Filee.Engines/Infrastructure/engines.json).
- pour télécharger les moteurs de conversion que vous choisissez d'installer, depuis les emplacements officiels fixés dans [`engines.json`](src/Filee.Engines/Infrastructure/engines.json), et les langues de reconnaissance de texte (OCR) qu'un préréglage utilise, fixées dans [`ocr-languages.json`](src/Filee.Engines/Infrastructure/ocr-languages.json).
- quand vous cliquez sur un lien, ce qui ouvre votre navigateur web.

## Soutenir Filee
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ It connects to the internet only:

- to ask GitHub (`api.github.com`) whether a newer release exists, shortly after start and then every few hours.
Turn this off in Settings → About ("Check for updates automatically").
- to download the conversion engines you choose to install, from the official locations pinned in [`engines.json`](src/Filee.Engines/Infrastructure/engines.json).
- to download the conversion engines you choose to install, from the official locations pinned in [`engines.json`](src/Filee.Engines/Infrastructure/engines.json), and the text recognition (OCR) languages a preset uses, pinned in [`ocr-languages.json`](src/Filee.Engines/Infrastructure/ocr-languages.json).
- when you click a link, which opens your web browser.

## Sponsor
Expand Down
2 changes: 1 addition & 1 deletion README.pt-BR.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ Ele se conecta à internet só:

- para perguntar ao GitHub (`api.github.com`) se existe uma versão mais nova, pouco depois de iniciar e depois a cada algumas horas.
Desligue isso em Configurações → Sobre (“Procurar atualizações automaticamente”).
- para baixar os motores de conversão que você escolher instalar, dos locais oficiais fixados em [`engines.json`](src/Filee.Engines/Infrastructure/engines.json).
- para baixar os motores de conversão que você escolher instalar, dos locais oficiais fixados em [`engines.json`](src/Filee.Engines/Infrastructure/engines.json), e os idiomas de reconhecimento de texto (OCR) que uma predefinição usa, fixados em [`ocr-languages.json`](src/Filee.Engines/Infrastructure/ocr-languages.json).
- quando você clica num link, o que abre o navegador.

## Patrocínio
Expand Down
2 changes: 1 addition & 1 deletion README.th.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ Filee ทำการแปลงไฟล์ภายในเครื่อ
การเชื่อมต่ออินเทอร์เน็ตจะเกิดขึ้นเฉพาะในกรณีต่อไปนี้:

- ตรวจสอบเวอร์ชันใหม่กับ GitHub (`api.github.com`) หลังเปิดโปรแกรมและทุกๆ สองสามชั่วโมง (ปิดได้ที่ การตั้งค่า → เกี่ยวกับ "ตรวจสอบการอัปเดตอัตโนมัติ")
- ดาวน์โหลดเครื่องมือแปลงไฟล์ที่คุณเลือกติดตั้ง จากแหล่งทางการที่ระบุไว้ใน [`engines.json`](src/Filee.Engines/Infrastructure/engines.json)
- ดาวน์โหลดเครื่องมือแปลงไฟล์ที่คุณเลือกติดตั้ง จากแหล่งทางการที่ระบุไว้ใน [`engines.json`](src/Filee.Engines/Infrastructure/engines.json) และภาษาสำหรับการรู้จำข้อความ (OCR) ที่พรีเซ็ตใช้ ซึ่งระบุไว้ใน [`ocr-languages.json`](src/Filee.Engines/Infrastructure/ocr-languages.json)
- เมื่อคุณคลิกลิงก์ ซึ่งจะเปิดหน้าเว็บในเบราว์เซอร์ของคุณ

## ผู้สนับสนุน (Sponsor)
Expand Down
2 changes: 2 additions & 0 deletions THIRD-PARTY-NOTICES.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ Downloaded from their official release pages when the user chooses to install th
| Microsoft Visual C++ Redistributable (for Ghostscript, conda-forge `vc14_runtime`) | Microsoft Visual C++ Redistributable license | https://github.com/conda-forge/vc-feedstock |
| FFmpeg 9.0.2 (gyan.dev "full_build-shared" Windows build; ffmpeg.exe, ffprobe.exe and their libraries, incl. x264, x265, libvpx, LAME, Opus, Vorbis, Theora, OpenCORE AMR) | GPL-3.0-or-later (the build is configured with `--enable-gpl --enable-version3`); FFmpeg itself LGPL-2.1-or-later | https://ffmpeg.org, build: https://www.gyan.dev/ffmpeg/builds/ (source: https://github.com/GyanD/codexffmpeg) |
| calibre (ebook-convert) | GPL-3.0 | https://calibre-ebook.com |
| Tesseract OCR 5.4 (UB Mannheim Windows build, with Leptonica and the MinGW libraries it ships; their notices are in its `doc` folder) | Apache-2.0 (Tesseract); Leptonica BSD-2-Clause; others as listed in the build | https://github.com/tesseract-ocr/tesseract, build: https://github.com/UB-Mannheim/tesseract |
| Tesseract language data (tessdata_fast 4.1.0), downloaded per language when used | Apache-2.0 | https://github.com/tesseract-ocr/tessdata_fast |

These programs run as separate processes. Their source code is available from the linked projects.

Expand Down
16 changes: 16 additions & 0 deletions build/fetch-engines.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
ffmpeg/ FFmpeg (GPL-3.0 build, separate program), video and audio; bin/ffmpeg.exe + bin/ffprobe.exe
calibre/ calibre (GPL-3.0, separate program), extracted from the official MSI via an administrative
install: ebook-convert for LIT, LRF, PDB, ... and MOBI / AZW3 output
tesseract/ Tesseract OCR (Apache-2.0, separate program), UB Mannheim's Windows build unpacked from its
installer with 7-Zip (never run); the language data is downloaded by the app when needed

Every download is pinned to a version and verified with SHA-256 (src/Filee.Engines/Infrastructure/engines.json,
shared with the app). Downloads are cached in build/.cache.
Expand Down Expand Up @@ -253,6 +255,20 @@ if ('ghostscript' -in $selected) {
Copy-VcRuntime $target
}

if ('tesseract' -in $selected) {
# Trimmed like EngineInstaller.TrimTesseract: no training programs, manuals, installer files or language data.
$setup = Get-Engine 'tesseract'
$sevenZip = Join-Path $Destination '7zip\7z.exe'
if (-not (Test-Path $sevenZip)) { throw 'Tesseract is unpacked with engines/7zip: use -Only 7zip,tesseract.' }
$target = Join-Path $Destination 'tesseract'
Reset-Folder $target
& $sevenZip x -y "-o$target" $setup | Out-Null
if ($LASTEXITCODE -ne 0) { throw "7-Zip could not unpack the Tesseract installer (exit code $LASTEXITCODE)." }
foreach ($folder in '$PLUGINSDIR', 'tessdata') { Remove-Item -LiteralPath (Join-Path $target $folder) -Recurse -Force -ErrorAction SilentlyContinue }
Get-ChildItem $target -File | Where-Object { $_.Extension -in '.exe', '.html' -and $_.Name -ne 'tesseract.exe' } | Remove-Item -Force
if (-not (Test-Path (Join-Path $target 'tesseract.exe'))) { throw 'tesseract.exe not found in the installer.' }
}

if ('calibre' -in $selected) {
$msi = Get-Engine 'calibre'
$tmp = Join-Path $cache 'calibre-admin'
Expand Down
40 changes: 37 additions & 3 deletions docs/ENGINES.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Filee chooses engines automatically. Settings → *Engines* shows their status,
| LibreOffice + H2Orestart + Java | **optional download** (~420 MB, 1.3 GB on disk) | older and rare formats only: DOC, XLS, PPT, RTF and OpenDocument → PDF and to each other, output as DOCX/ODT/ODS/ODP; HWP/HWPX → DOCX/ODT; read-only formats (see below) → PDF and their kind's editable formats; FODT, OpenDocument templates (OTT, OTS, OTP) and XLT out; SVG → EMF/WMF/ODG, a PDF page → SVG |
| Pandoc | **optional download** (~42 MB, 240 MB on disk) | Markdown ↔ DOCX/ODT/RTF, DOCX/ODT/HTML/RTF → Markdown, HTML ↔ DOCX/ODT, markup languages (reStructuredText, LaTeX, Org, AsciiDoc, Typst, MediaWiki, DocBook, Jupyter, Textile, man, OPML) ↔ Markdown/HTML/DOCX/ODT and each other (and → RTF, EPUB, TXT), Markdown and markup → PPTX slides |
| Ghostscript | **optional download** (~20 MB, 31 MB on disk) | EPS/PS → PDF, PDF → EPS/PS, PostScript-based AI → PDF (images through PDF and PDFium); smaller PDFs when a preset asks for it |
| Tesseract | **optional download** (~50 MB, 160 MB on disk; each language 0.4–10 MB when first used) | **text recognition (OCR)**: scans and pictures → searchable PDF, and their text into DOCX, TXT, Markdown and HWPX ("Recognize text" in the preset, see below) |
| FFmpeg | **optional download** (~100 MB, 272 MB on disk) | **all video and audio**: video ↔ video (H.264, HEVC, AV1), video → animated GIF / APNG, a still frame or every frame, audio and subtitle extraction, audio ↔ audio (also APE, WavPack, TTA, DSD, DTS, ALAC, …), GIF, APNG and photos → MP4/WEBM/MOV, Live / Motion Photos → their video, a clip of a video → an iPhone Live Photo or Android Motion Photo (experimental), images → HEIC, clips or audio files joined into one, pictures → a slideshow MP4, copies without metadata (see "Media tools") |
| Calibre | **optional download** (~216 MB, 660 MB on disk) | rare e-book formats: LIT, LRF, CHM, PDB, PML, RB, SNB, TCR, OEB → EPUB; EPUB → MOBI, AZW3, LIT, LRF, PDB, PML, RB, SNB, TCR; e-books → PDF (ranked above the HWPX writer, see below) |

Expand Down Expand Up @@ -69,10 +70,11 @@ the same on every PC. An external engine is looked for in this order:
1. a copy the user picked in Settings → *Engines*;
2. Filee's own copy (bundled or downloaded);
3. a copy already on the computer: on `PATH`, in Homebrew's and the usual Unix folders, or where the LibreOffice,
calibre and Ghostscript installers put it. Settings → *Engines* shows it as "Found on this PC", with a note when
calibre, Ghostscript and Tesseract installers put it. Settings → *Engines* shows it as "Found on this PC", with a note when
its version is older than the one Filee downloads.

Where Filee has no download of an engine (FFmpeg and Ghostscript on macOS, LibreOffice and Ghostscript on Linux),
Where Filee has no download of an engine (FFmpeg, Ghostscript and Tesseract on macOS, LibreOffice, Ghostscript and
Tesseract on Linux),
step 3 is how it is found. Microsoft Office
and Hancom Office are never used, even when installed. Running from source, the repository's `engines/` folder
(filled by `build/fetch-engines.ps1`) is used.
Expand All @@ -97,6 +99,11 @@ they can be installed or removed later in Settings → *Engines*. A conversion t
zstd tarball, of which only `Library/bin` is unpacked (SharpCompress; `fetch-engines.ps1` uses Windows' `tar.exe`).
Its fonts and resources are compiled into `gsdll64.dll`. The Microsoft C++ runtime it was built against
(`vcruntime` component) is copied next to `gswin64c.exe`, so it runs on PCs without the VC++ Redistributable.
- Tesseract is UB Mannheim's Windows build (the one Tesseract's documentation points to), published only as an NSIS
installer. It is never run: Filee's own 7-Zip unpacks it (`nsis` kind), and the training programs, manuals,
installer files and bundled language data are removed (`TrimTesseract`, ~80 MB). The languages come from
`tessdata_fast` 4.1.0, pinned like the engines in `Infrastructure/ocr-languages.json` (`traineddata` kind, one
folder per language under `engines/ocr-languages`), and are downloaded the first time a preset uses one.

### Microsoft C++ runtime (Windows)

Expand All @@ -111,7 +118,7 @@ the runtime next to every program that needs it and does not ship it (`Infrastru
| Ghostscript (download) | `vcruntime` component copied next to `gswin64c.exe` (`EngineInstaller`, `fetch-engines.ps1`) |
| LibreOffice (download) | its own copy, which the administrative install leaves in `System64`, copied into `program/` (`EngineInstaller`, `fetch-engines.ps1`; `LibreOfficeConverter` also repairs a copy installed by an earlier Filee) |
| calibre, Java (downloads) | ship their own next to their programs (`app/bin`, `bin`) |
| 7-Zip, FFmpeg (GyanD), Pandoc, PDFium, SkiaSharp / HarfBuzz, Magick.Native, the Explorer menu DLL, .NET | import neither (static runtime or MinGW / GHC builds) |
| 7-Zip, FFmpeg (GyanD), Tesseract (UB Mannheim, MinGW), Pandoc, PDFium, SkiaSharp / HarfBuzz, Magick.Native, the Explorer menu DLL, .NET | import neither (static runtime or MinGW / GHC builds) |

The installer and the portable zip are made from the same publish folder, so both have the DLLs. Filee installed in
Program Files cannot repair its own bundled files, so an older installation gets them by installing the new version.
Expand Down Expand Up @@ -1523,3 +1530,30 @@ format, and FFmpeg reads what the file holds, so a `.dat` with no video in it fa
`nclx` sRGB, BT.601 full range when there is none) and Exif (orientation reset to 1, thumbnail removed) as a `cdsc`
item. Checked with libheif (Magick.NET), FFmpeg's HEIF demuxer and Windows' HEIF/HEVC extensions; a smooth 2000 ×
1500 picture is a quarter the size of a JPG at the same PSNR.

## Text recognition (OCR)

"Recognize text" (`PdfOptions.Ocr`, issue #288) in a preset for PDF, DOCX, TXT, Markdown or HWPX reads the text of
scans and pictures with Tesseract (`Ocr/TesseractConverter.cs`), in the language the preset names
(`PdfOptions.OcrLanguage`, a Tesseract code; English by default). The built-in "Searchable PDF" preset turns it on.

- The route planner puts an OCR edge first (`ConversionEdge.Ocr`, `RoutePlanner.Plan(ocr: true)`): picture or PDF →
searchable PDF, then the cheapest ordinary route from that PDF. A picture Tesseract can't open (HEIC, PSD, …)
becomes a PNG first. OCR edges are never part of an ordinary route.
- A searchable PDF keeps the page as it looks and puts the recognized words on it as invisible text. PDF pages that
already have text (visible or an OCR layer) are copied as they are. A scan with a stamp still counts as a scan: a
picture over at least half the page whose only text is visible and covers under 1% of it (a page number or Bates
number the scanner software added). Only the others are rendered at 300 dpi
(PDFium) and recognized page by page: a page is rendered when one of at most four Tesseract runs (fewer on PCs with
fewer cores) is free, each with one thread (`OMP_THREAD_LIMIT=1`), and its picture is deleted once its PDF exists,
so a long scan never has more than four pictures in the work folder. A PDF whose
pages all have text is copied with a note. The new document keeps the pages and the document information, not
bookmarks or form fields.
- DOCX, Markdown and HWPX read the OCR layer as the page's text (`PdfDocumentReader.ReadWithOcrLayer`): the words
become paragraphs, the scan behind them is left out, and Tesseract's placeholder font is dropped. Without OCR an
OCR layer stays invisible there and the page stays a picture, as before. TXT always reads it.
- PDFs merged into one ("Merge PDF" with OCR) are recognized before they are merged.
- Pictures without a resolution are read at 300 dpi; Tesseract would otherwise assume 70 dpi and make a huge page.
- The language data is copied into the job's folder and passed with `--tessdata-dir`, so a system Tesseract reads
only Filee's pinned files; `-c tessedit_create_pdf=1` replaces the `pdf` config file that lives in Tesseract's own
tessdata folder.
Loading
Loading