[Bug]: changed images in the web interface do not show (plus fix suggestion!)
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 36.9k
- Forks
- 5.2k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 713
Description
⚠️ This issue respects the following points: ⚠️
- This is a bug, not a question or a configuration/webserver/proxy issue.
- This issue is not already reported on Github OR Nextcloud Community Forum (I've searched it).
- Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
- I agree to follow Nextcloud's Code of Conduct.
Bug description
Nextcloud nicely generates images to be shown in the web interface, also there is an image editor available. When one changes something in an image, the preview doesn't seem to update..
Steps to reproduce
- upload an image
- change it via the web interface (add some text for instance)
- preview image does not seem to change
Expected behavior
One would expect to see the changed image..
FIX SUGGESTION
I have this problem in my coding sometimes too. The problem is the caching of the browser. There is a little trick to fix this:
The image URL is something like:
[URL]/core/preview?fileId=964&x=1920&y=1080&a=true
When one would add something unique, like the file time ('storage_mtime' in 'oc_filecache' would seem to be perfectly suitable for this) then the URL becomes a new one and one can force an update. Something like:
[URL]/core/preview?fileId=964&x=1920&y=1080&a=true&mtime=1674741268
Then that URL gets cached (do not add a random number, that would strain the caching unnecessarily)
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 by tracing the /core/preview request and how edited-image previews are cached; inspect the file metadata represented by oc_filecache. Reproduce the issue by editing an uploaded image, then verify that the web preview reflects the changed image without unnecessarily defeating browser caching.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, php
- Domain
- backend, frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100