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

Option to open images in full resolution #266

Closed
TtuxX opened this issue Nov 29, 2022 · 23 comments
Closed

Option to open images in full resolution #266

TtuxX opened this issue Nov 29, 2022 · 23 comments
Labels
feature New feature or request
Milestone

Comments

@TtuxX
Copy link

TtuxX commented Nov 29, 2022

Hi :)

Would it be possible to have an option that, when user loads an image, show it in full resolution ?
It would not change anything to previews quality (and app reactivity), but, when user activates this option, it would start preloading the full quality image on mouse hover, then definitely load the full quality zoomable picture on click.

Besides, it currently seems to me that I cannot zoom anymore on any of my pictures inside Memories app (will open an issue for this).

Thank you very much in advance :)

@pulsejet
Copy link
Owner

pulsejet commented Nov 29, 2022

Hi :)

Would it be possible to have an option that, when user loads an image, show it in full resolution ? It would not change anything to previews quality (and app reactivity), but, when user activates this option, it would start preloading the full quality image on mouse hover, then definitely load the full quality zoomable picture on click.

#226

Besides, it currently seems to me that I cannot zoom anymore on any of my pictures inside Memories app (will open an issue for this).

How are trying to zoom? Mobile / desktop? Browser? On desktop just the mouse wheel should work for zooming.

@TtuxX
Copy link
Author

TtuxX commented Nov 29, 2022

Yes I hesitated to add a comment but opened another issue given that it is more about loading in full quality rather than preview. If you prefer I can close this issue and continue on the other one.

I am trying to zoom on Desktop (firefox 106.0.5 for mac), and confirm that mouse wheel scroll does not work.

@pulsejet
Copy link
Owner

Yes I hesitated to add a comment but opened another issue given that it is more about loading in full quality rather than preview. If you prefer I can close this issue and continue on the other one.

We can't really load the full image for two reasons:

  1. There are huge photos (I have 108MP). The browser chokes on this. Having on option to load the full image would lead to people turning it on, then complaining the app is sluggish. The correct solution is to lazy-load parts of the high res image after the user zooms in (this is what Google Photos does). But this is neither easy to implement nor light for the server.
  2. Format support. Browsers don't support many formats at all, e.g. HEIC. In this case we need to load the previews anyway.

I am trying to zoom on Desktop (firefox 106.0.5 for mac), and confirm that mouse wheel scroll does not work.

Strange. Does zooming work in the demo? Try from a private window.

@TtuxX
Copy link
Author

TtuxX commented Nov 29, 2022

We can't really load the full image for two reasons:

Very interesting! What about limiting it to loading pictures under a certain size, like 10mb (and if the picture size is more important, load the preview with a toaster notification about its important size) ?

Strange. Does zooming work in the demo? Try from a private window.

It works perfectly fine on your server (without even using a private window). I am going to try few more things on my side.

@pulsejet
Copy link
Owner

Very interesting! What about limiting it to loading pictures under a certain size, like 10mb (and if the picture size is more important, load the preview with a toaster notification about its important size) ?

It's the pixel count that matters, so yes we could use that to selectively load smaller ones. I'm just afraid inconsistent behavior leads to weird bugs. Especially when, as I mentioned, there's a "correct" way to do this.

It works perfectly fine on your server (without even using a private window). I am going to try few more things on my side.

Try clearing your browser cache. Also I assume you're on v4.8.2.

@TtuxX
Copy link
Author

TtuxX commented Nov 29, 2022

Especially when, as I mentioned, there's a "correct" way to do this.

Yes you're right. Lazy load would be awesome but if it is a hassle to implement, it should certainly not be the priority at all.

Try clearing your browser cache. Also I assume you're on v4.8.2.

I tried on chromium browser and the result is the same. I wonder if it might be linked to some patch I applied on my server to load images in full quality when opened in the files viewer...
I will try to investigate.

@pulsejet
Copy link
Owner

I tried on chromium browser and the result is the same. I wonder if it might be linked to some patch I applied on my server to load images in full quality when opened in the files viewer... I will try to investigate.

If that's the nextcloud viewer, then no. That isn't used by memories.

@major-mayer
Copy link

For me, zooming works fine on my instance (using Firefox)

@thorgrin
Copy link

thorgrin commented Dec 2, 2022

Zooming works fine, but by default it loads only 1024x1024 previews, which is not nice for photo presentations. Is there a way to increase that? The default maximum preview size in nextcloud seems to be 4096x4096. Could this be configurable?

@pulsejet
Copy link
Owner

pulsejet commented Dec 3, 2022

With memories v4.9+, the preview size will be whatever maximum is configured and suitable for the screen size (generally the 4096x4096 preview).

The broader problem with generating these previews is that they are huge. My photos are in HEIC, mostly 12MP, and each photo is ~1MB. If I generate 4096x4096 previews (that's 16MP), then each of these are ~2MB (!) so my preview folder gets bigger (by a lot) than the originals.

My current thought is to provide a system-wide option to load the full image; they would optionally be converted to JPEG on the fly. The caveat is that this has high CPU usage and is very slow for larger images (>6s for a 64MP HEIC on a very fast machine). Another problem, of course, is that bigger images choke the browser. Client side conversion is unusable (20s for the same image).

@pulsejet pulsejet added this to the v4.9.0 milestone Dec 3, 2022
@pulsejet pulsejet added the feature New feature or request label Dec 3, 2022
@pulsejet pulsejet mentioned this issue Dec 3, 2022
@pulsejet pulsejet removed this from the v4.9.0 milestone Dec 3, 2022
@omeryagmurlu
Copy link

This (and a similar issue in nextcloud viewer: nextcloud/viewer#578) irritated me a lot that I went and patched the app with a workaround. While waiting for an official solution, you can use this workaround:

Change this line

let previewUrl = getPreviewUrl(photo, false, 1024);
to

let previewUrl = getDownloadLink(photo);

and build the app with:

npm ci
make build-js-production

You must swap the memories-main.js file with the new version. I use nextcloud on docker and used the bind volume type to do this:

    volumes:
      
      - type: bind
        source: ./workarounds/nextcloud/viewer/memories-main.js
        target: /config/www/nextcloud/apps/memories/js/memories-main.js
        read_only: true
      

With this workaround you see the preview image that was used in the timeline until the original image loads in, after that the preview is swapped automatically with the original image.

@TtuxX
Copy link
Author

TtuxX commented Dec 15, 2022

On the zooming issue:

If that's the nextcloud viewer, then no. That isn't used by memories.

Well I tried again with NC 25.0.2. I can zoom with a wheel scroll on pictures with Nextcloud files viewer, but cannot with the same picture when using Memories

@ikamaletdinov
Copy link

@omeryagmurlu Unfortunately workaround does not work with HEIC files on iphone. (but works pretty good for other files).

@jonas-w
Copy link

jonas-w commented Mar 11, 2023

@omeryagmurlu thanks, works excellent!

The file has moved, it is now at:

let previewUrl = getPreviewUrl(photo, false, [sw, sh]);

@ikamaletdinov
Copy link

@pulsejet That is really important feature. Could it be implemented somehow and at least enabled for some filetypes? (I mean jpeg/png and etc. except HEIC) Thanks in advance!

@pulsejet pulsejet added this to the 4.13 milestone Mar 15, 2023
@pulsejet
Copy link
Owner

v4.12.1 will let you load the full image on zoom (default) or always (expensive).

Be warned that this may be incredibly slow if:

  1. You've large images
  2. You've anything other than JPEG/PNG/WEBP/GIF
  3. On mobile devices
  4. On low bandwidth

image

@TtuxX
Copy link
Author

TtuxX commented Mar 16, 2023

@pulsejet Thank you so much, I tried it and it is awesome !!

Would it be possible to improve it slightly to:

  • Remember the "Always load full size image" user's switch selected position
  • Allow the user to zoom a picture even is its resolution is lower than the one of the display (there are many pictures which I cannot zoom in)

@pulsejet
Copy link
Owner

  • Remember the "Always load full size image" user's switch selected position

This is remembered. It's just device-specific, since you might want different behavior on e.g. mobile and desktop.

  • Allow the user to zoom a picture even is its resolution is lower than the one of the display (there are many pictures which I cannot zoom in)

I believe this is forbidden in the upstream library, so no easy solution for now.

@ikamaletdinov
Copy link

@pulsejet Marvelous change! Looks great on my setup even though with HEIC images. (local network server just for home backups usage)

@MayeulC
Copy link

MayeulC commented Mar 17, 2023

You've anything other than JPEG/PNG/WEBP/GIF

I wonder if other formats (HEIC) couldn't be decoded client-side, perhaps with a WASM build of ffmpeg? Of course, this may make user experience more inconsistent between devices... OTOH, users expect slower devices to display images slower.

@pulsejet
Copy link
Owner

It's possible but very slow. That also takes away the possibility of caching the JPEG server-side in the future.

@vpatil131
Copy link

How do I access the "General" settings on a mobile browser like Safari on iPhone? On desktop browser, it's at bottom left corner but can't seem to find any such option in the mobile browser.

@pulsejet
Copy link
Owner

pulsejet commented Aug 1, 2023

@vpatil131 it's in the "Explore" tab => "Settings"
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

9 participants