img_to_ndarray passed the raw PIL array straight to convert_img. For
palette (P) images that array holds palette indices, so a typical
two-colour PNG reaches the detector as an almost black image and no
text is found. CMYK images give four ink channels that were treated as
RGBA, so a CMYK JPEG also returned no result.
Convert P images to RGBA, which keeps any palette transparency for the
existing alpha handling, and CMYK images to RGB. Path, bytes and PIL
inputs all go through this function.
- pass --lang_type into RapidOCR recognition config
- skip CLI visualization when OCR or word results are empty
- validate parameter update keys before applying config updates
- add regression tests for CLI language, empty visualization, and invalid params