mirror of
https://github.com/ciur/papermerge.git
synced 2026-04-25 03:55:58 +03:00
[GH-ISSUE #571] Additionally installed OCR language is rejected by web UI backend #443
Labels
No labels
2.1
3.0
3.0.1
3.0.2
3.0.3
3.0.3
3.1
3.2
3.2
3.3
3.5
3.x
Fixed. Waiting for feedback.
Fixed. Waiting for feedback.
UX
Version 2.1 - alpha
XSS
announcement
beta
blocker
bug
cannot reproduce
confirmed
confirmed
critical
demo
dependencies
deployment
detchnical debt
discussion
docker
documentation
donations
duplicate
enhancement
feature request
frontend
fundraising
good first issue
good issue
help wanted
high
implemented
important
improvement
incomplete
invalid
investigation
kubernetes
low
low impact
medium
medium
medium impact
migration from 2.0
migration from 2.1
missing-language
missing-ocr-language
no-activity
note
ocr
outofscope
packaging
performance
popular request
pull-request
pypi
question
raspberry pi
roadmap
search
security
setup
status
task
technical debt
updates
user xp
version 1.4.0 - demo
will be implemented
will not be implemented
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/papermerge#443
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @lehnerpat on GitHub (Dec 31, 2023).
Original GitHub issue: https://github.com/ciur/papermerge/issues/571
Originally assigned to: @ciur on GitHub.
Description
After installing an additional OCR language (for example, Japanese) as described in the docs, the additional language can be used in OCR by setting it as the default, but it cannot be used from the web UI because the backend rejects it as an invalid value.
Expected
Additionally installed languages should be usable from web UI, just like the default languages.
Actual

The additional language shows up in the language selection dropdown for running OCR:
But when you click "Start", the backend responds with a 422 error saying the additional language is not an allowed value for the enum.
Additionally, the UI completely ignores this error and doesn't show any error message :(
Full error payload:
Browser console screenshot:

Info:
More info about setup:
Using custom docker image with Japanese language package for tesseract installed, following instructions: https://docs.papermerge.io/3.0/setup/add-ocr-langs/
Dockerfile:
Built with:
docker build -t mypaper:3.0 -f Dockerfile .Using Docker Compose, following instructions: https://docs.papermerge.io/3.0/setup/docker-compose/
mypaper:3.0)PAPERMERGE__OCR__DEFAULT_LANGUAGE: jpn@ciur commented on GitHub (Dec 31, 2023):
Thank you for well structured bug report!
The issue happens because currently the language codes are hardcoded:
The fix would be to, well, just extend current set of hardcoded values with another batch of languages (incl. Japanese).
@ciur commented on GitHub (Jan 12, 2024):
PR#300 to include extra language codes (incl. Japanese)
Pull request was merged and it will available as part of Papermerge 3.0.1 release.
@ciur commented on GitHub (Jan 25, 2024):
Fixed in 3.0.2