Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: changed images in the web interface do not show (plus fix suggestion!) #40230

Open
4 tasks done
mrAceT opened this issue Sep 4, 2023 · 4 comments
Open
4 tasks done

Comments

@mrAceT
Copy link

mrAceT commented Sep 4, 2023

⚠️ This issue respects the following points: ⚠️

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

  1. upload an image
  2. change it via the web interface (add some text for instance)
  3. 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)

@mrAceT mrAceT added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Sep 4, 2023
@szaimen

This comment was marked as resolved.

@szaimen szaimen added technical debt and removed bug labels Sep 4, 2023
@artonge
Copy link
Contributor

artonge commented Sep 4, 2023

Indeed, here is an example how the Photos app tackled this: https://github.com/nextcloud/photos/blob/master/src/components/File.vue#L213

@artonge artonge mentioned this issue Sep 4, 2023
26 tasks
@skjnldsv
Copy link
Member

skjnldsv commented Sep 5, 2023

The Viewer needs to trigger the right event and we need to update the etag accordingly then.

@skjnldsv skjnldsv added 1. to develop Accepted and waiting to be taken care of feature: files and removed 0. Needs triage Pending check for reproducibility or if it fits our roadmap labels Sep 5, 2023
@skjnldsv skjnldsv added this to Legacy bugs in Files to vue via automation Sep 5, 2023
@artonge
Copy link
Contributor

artonge commented Sep 5, 2023

It already does with updated data:
https://github.com/nextcloud/viewer/blob/4523801d037d736da3186cef161d4b93130422db/src/components/ImageEditor.vue#L184-L197

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Files to vue
  
Legacy bugs
Development

No branches or pull requests

5 participants