Photo

any2jpg

Description

any2jpg is a Windows command-line utility that turns the first page of a document into a JPEG thumbnail. Input is either the document file itself or an archive (ZIP/TAR) containing a document; the format is detected automatically, page 1 is rendered at 400 px wide by default (tunable via -w, JPEG quality 85), and the result is saved to file.jpg.

The project builds a single self-contained executable (any2jpg.exe) with statically linked dependencies - no DLLs, no runtime, no installation. The utility is designed as a lightweight cover generator: for any common document format (or an archive with unknown contents) it quickly produces a small JPEG preview of the first page. Typical scenarios: generating covers/thumbnails for document catalogs and libraries, previewing documents stored in archives, building graphical indexes of mixed document collections.

The program is a single C file (main.c) driving two rendering engines: MuPDF - for PDF, EPUB, MOBI, FB2, DOCX, XLSX, PPTX, HTML and TXT; DjVuLibre - for DjVu. Both engines render the page into an in-memory RGB buffer, which is then encoded to JPEG by MuPDF's built-in JPEG encoder.

Modules used

Technologies

Resources

Open GitHub Download any2jpg.zip