nextcloud / nextcloud/richdocuments
Watermark BeforeFetchPreviewListener returns 404 for png and jpg in Files
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 453
- Forks
- 147
- Avg merge
- 14h 54m
- Merged PRs (30d)
- 83
Description
Describe the bug
When Watermark is enabled in Richdocuments, then I cannot get a preview anymore for png and jpg files, but get a 404 error.
To Reproduce
Steps to reproduce the behavior:
- Enable Watermark in Nextcloud Office settings in Administration
- In Files, click on a PNG picture, to see the preview.
- You get a 404 error
Expected behavior
I would only expect this to affect documents managed by Richdocuments, eg. Text, Spreadsheet, etc, but not png and jpg files.
It says on the admin screen: "The settings only apply to compatible office files that are opened in Nextcloud Office"
The preview fails with 404, because of https://github.com/nextcloud/richdocuments/blob/main/lib/Listener/BeforeFetchPreviewListener.php#L80
I suggest to only throw a NotFoundException if the document is an office document.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with lib/Listener/BeforeFetchPreviewListener.php around line 80 and review how the listener handles PNG and JPG previews versus office documents. Verify that previews for image files no longer return 404 while the watermark behavior remains limited to compatible office files.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100