Add OCR PDF export and default DPI presets#155
Conversation
0ce5ffe to
843deaa
Compare
|
Hi @JFly02, thank you very much for your PR. Currently, ScanBridge is undergoing a major refactoring to move to a more Clean Architecture oriented approach. One independent issue, though, is that MLKit is not open-source. So, I won't be able to use the OCR part of this PR for the F-Droid version currently. For other distribution paths, I would need to change the project license to something like Apache as MLKit is GPL incompatible (but this was planned anyway). Ideally, the OCR provider would be something truly open source, although I know that Tesseract most likely performs much worse than MLKit. But I think I can give a compromise: I suggest extracting the OCR provider to an interface so that it is easily swappable. The F-Droid version would use a Tesseract-based implementation, Google Play can use the MLKit variant and on the release page there could be multiple variants. Examples how exactly this abstraction should be structured will be found in the codebase after the refactoring, so maybe it would be better to wait for this to complete before trying to create the abstraction. As for the setting, it is definitely a great idea. We will have to adapt this to use the new settings system that comes with the new refactoring though (Datastores are not used anymore because they are KMP incompatible, all data is managed in Room now) |
|
Sorry, that I can't merge this yet. Kinda of an inconvenient moment in time because of the refactor. |
|
Hi Chrisimx, thanks a lot for the thoughtful reply and for explaining the bigger picture a bit. That all sounds very reasonable. The licensing point around MLKit makes total sense, especially with F-Droid in mind, and I also get that this is probably the wrong moment to build too much on top of parts that are about to change during the refactoring. I still really like the idea of OCR and the DPI setting, so I’d be happy to revisit both once the refactoring has settled down a bit. In particular, I can rework the OCR idea with a much stronger open-source focus and in a way that fits the new architecture better, ideally with a swappable provider approach like you described. Same for the settings side: once the new Room-based system is in place, I can reimplement the DPI setting in a way that matches the new structure properly instead of forcing it into something that’s already being phased out. Thanks again for the detailed feedback. I really appreciate it, and I’d be glad to take another pass at this later in a cleaner, more open-source-friendly form after the refactoring is done. |
This PR adds searchable OCR PDF export and introduces clean default DPI presets for new scan sessions.
Changes:
Notes: