feat(magic): suggest OCR on image inputs (Magic)

- Add Magic checks to Optical Character Recognition to detect common image formats via magic bytes
- Provide default args (show confidence, LSTM engine) when auto-suggested

Authored-by: Izai Alejandro Zalles Merino <zallesrene@gmail.com>
This commit is contained in:
Izai Alejandro Zalles Merino 2025-10-13 09:47:44 -04:00
parent a4f40405ef
commit de2a83c0a0

View file

@ -46,6 +46,13 @@ class OpticalCharacterRecognition extends Operation {
defaultIndex: 1
}
];
this.checks = [
{
pattern: "^(?:\xff\xd8\xff|\x89\x50\x4e\x47|\x47\x49\x46|.{8}\x57\x45\x42\x50|\x42\x4d)",
args: [true, "LSTM only"],
useful: true
}
];
}
/**