Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
deepin-ocr (6.5.12) unstable; urgency=medium

* Add the OCR V5 plugin.

-- dengzhongyuan <dengzhongyuan@uniontech.com> Thu, 30 Oct 2025 18:42:34 +0800

deepin-ocr (6.5.11) unstable; urgency=medium

* chore: Adjust pkg-config dependency
Expand Down
21 changes: 20 additions & 1 deletion src/engine/OCREngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,27 @@
//此处存在产品设计缺陷: 无法选择插件,无鉴权入口,无性能方面的高级设置入口
//因此此处直接硬编码使用默认插件
qCInfo(dmOcr) << "Initializing OCR driver";

ocrDriver = new Dtk::Ocr::DOcr;

Check warning on line 29 in src/engine/OCREngine.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Class 'OCREngine' does not have a operator= which is recommended since it has dynamic memory/resource allocation(s).

Check warning on line 29 in src/engine/OCREngine.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Class 'OCREngine' does not have a copy constructor which is recommended since it has dynamic memory/resource allocation(s).
ocrDriver->loadDefaultPlugin();
const QString ocrV5 = "PPOCR_V5";
bool load = false;

auto plugins = ocrDriver->installedPluginNames();
if (plugins.contains(ocrV5, Qt::CaseInsensitive)) {
if(ocrDriver->loadPlugin(ocrV5)) {
load = true;
qCInfo(dmOcr) << "OCR V5 plugin loaded";
}
else {
qCWarning(dmOcr) << "Failed to load OCR V5 plugin";
}
}

if(!load) {
ocrDriver->loadDefaultPlugin();
qCInfo(dmOcr) << "Default OCR plugin loaded";
}

ocrDriver->setUseMaxThreadsCount(2);
QFileInfo mtfi("/dev/mtgpu.0");
if (mtfi.exists()) {
Expand Down
Loading