OCRmyPDF icon indicating copy to clipboard operation
OCRmyPDF copied to clipboard

[Bug]: Minor Bug, YAML -env OCR_OUTPUT_DIRECTORY_YEAR_MONTH=0 is ignored

Open CaipaRinha opened this issue 6 months ago • 8 comments

What were you trying to do?

Updated docker image today jbarlow83/ocrmypdf:latest

and it seems YAML statement

OCR_OUTPUT_DIRECTORY_YEAR_MONTH=0

is no longer respected or syntax has changed. Before update output was posted to :/output now it is posted to :/output/2025/7. I can't say which version exactly was used before, rough timeline would put it at around May 2025.

Complete YAML:

version: "3.3" services: ocrmypdf: restart: unless-stopped container_name: ocrmypdf image: jbarlow83/ocrmypdf:latest volumes: - "/volume1/docker/ocrmypdf/scan2ocr:/input" - "/volume1/docker/ocrmypdf/pfda:/output" - "/volume1/docker/ocrmypdf/originals:/processed" environment: - OCR_ON_SUCCESS_ARCHIVE=1 - OCR_DESKEW=1 - 'OCR_JSON_SETTINGS={"skip-text": true, "l": "deu", "optimize": "1"}' - OCR_OUTPUT_DIRECTORY_YEAR_MONTH=0 user: "1056:108" entrypoint: python3 command: watcher.py

Where are you installing/running from?

Docker container

OCRmyPDF version

ocrmypdf --16.10.2

What operating system are you working on?

No response

Operating system details and version

No response

Simple sanity checks

  • [ ] Operating system is currently supported by its vendor (not end of life)
  • [ ] Python version is compatible with OCRmyPDF
  • [x] This issue is not about a specific input file

Relevant log output


CaipaRinha avatar Jul 07 '25 11:07 CaipaRinha

restarting fixed the issue. No idea what happened. closed the issue.

CaipaRinha avatar Jul 07 '25 11:07 CaipaRinha

Apparently not. Issues persists. Sorry for flip flopping.

CaipaRinha avatar Jul 07 '25 12:07 CaipaRinha

Try OCR_OUTPUT_DIRECTORY_YEAR_MONTH=false

amMistic avatar Jul 10 '25 10:07 amMistic

A typing error seems to have crept in. For me it works with OCR_OUTPUT_DIRECTORY_YEAR_MONT=0 The change was between version v16.10.2 to v16.10.4.

jammerhund avatar Jul 18 '25 10:07 jammerhund

Try OCR_OUTPUT_DIRECTORY_YEAR_MONTH=false

A typing error seems to have crept in. For me it works with OCR_OUTPUT_DIRECTORY_YEAR_MONT=0 The change was between version v16.10.2 to v16.10.4.

Both sugestions are not working for me. What else could i try?

napomat avatar Jul 24 '25 06:07 napomat

I believe this is an issue in typer - it seems that all environment variables are now truthy, regardless of value, in its interpretation.

jbarlow83 avatar Aug 13 '25 08:08 jbarlow83

Thanks. I think it also affects optimization and causes issues. Just additional information.

I've just run the app again with my specific pdf and above parameters:

Original file: Size: 4.307.001 bytes v16.10.4 output: 4.417.766 bytes (+2.5%) v16.10.2 output: 4.261.261 bytes (-1.0%)

It's a minor change, but it's the difference between compressing and expanding the file size.

CaipaRinha avatar Aug 18 '25 13:08 CaipaRinha

@napomat

Both sugestions are not working for me. What else could i try?

My suggestion for now would be or revert to :v16.10.2 instead of using :latest it's what I am doing, v16.10.2 works fine for me, tbh 8)

CaipaRinha avatar Aug 18 '25 13:08 CaipaRinha