<?php

return [
    // Master switch. When off, large scanned docs that exceed the vision page limit are
    // marked 'skipped' rather than OCR'd.
    'enabled' => env('OCR_ENABLED', true),

    // Binaries — override per environment (Windows dev vs Linux prod). Absolute paths are
    // fine, e.g. '/usr/bin/tesseract'. Requires tesseract-ocr plus a rasterizer (poppler's
    // pdftoppm OR ghostscript). pdfinfo is optional — page counts fall back to the bundled
    // PDF parser.
    'tesseract_bin' => env('OCR_TESSERACT_BIN', 'tesseract'),
    'pdftoppm_bin'  => env('OCR_PDFTOPPM_BIN', 'pdftoppm'),   // poppler-utils (preferred)
    'gs_bin'        => env('OCR_GS_BIN', 'gs'),               // ghostscript (fallback rasterizer)
    'pdfinfo_bin'   => env('OCR_PDFINFO_BIN', 'pdfinfo'),     // optional

    // Which rasterizer to use: 'auto' (prefer pdftoppm, else ghostscript), 'pdftoppm', or 'gs'.
    'rasterizer' => env('OCR_RASTERIZER', 'auto'),

    'language' => env('OCR_LANGUAGE', 'eng'),
    'dpi'      => (int) env('OCR_DPI', 300),

    // A scanned doc with more pages than this uses the async OCR pipeline instead of a
    // single vision request. When OCR tooling is available, scanned docs of ANY size are
    // routed through OCR (for exact page numbers + real bounding boxes); this cap only
    // governs the vision fallback used when OCR is unavailable.
    'vision_max_pages' => (int) env('OCR_VISION_MAX_PAGES', 80),

    // Pages OCR'd + extracted per job invocation. Keeps each run comfortably under the queue
    // timeout; the job re-dispatches itself for the next range until the doc is finished.
    'pages_per_run' => (int) env('OCR_PAGES_PER_RUN', 100),
];
