richdocuments icon indicating copy to clipboard operation
richdocuments copied to clipboard

Watermark BeforeFetchPreviewListener returns 404 for png and jpg in Files

Open tpokorra opened this issue 2 years ago • 0 comments

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:

  1. Enable Watermark in Nextcloud Office settings in Administration
  2. In Files, click on a PNG picture, to see the preview.
  3. 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.

tpokorra avatar Mar 03 '23 05:03 tpokorra