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

Add no-crop thumbnails rendering in images preview #5179

Closed
pasnox opened this issue Dec 4, 2022 · 8 comments · Fixed by #7409 or owncloud/web#9806
Closed

Add no-crop thumbnails rendering in images preview #5179

pasnox opened this issue Dec 4, 2022 · 8 comments · Fixed by #7409 or owncloud/web#9806
Assignees
Labels

Comments

@pasnox
Copy link

pasnox commented Dec 4, 2022

Describe the bug

Image preview is broken.
It regularly produce thumbnails that truncate most of the images and make the previewing in Space useless.

Steps to reproduce

Steps to reproduce the behavior:

  1. Create a space
  2. Upload a bunch of landscape and portrait photos
  3. Preview them, in most occasion the thumbnail produced is truncated

Expected behavior

The image is always entirely visible, downscaling it if needed to fit in the client screen

Actual behavior

Thumbnails seems to be cropped instead of downscaled

Setup

OCIS_URL="https://host.com:8888" \
OCIS_CONFIG_DIR="${HOME}/ocis/config" \
OCIS_BASE_DATA_PATH="${HOME}/ocis/data" \
OCIS_INSECURE=false \
PROXY_TRANSPORT_TLS_KEY="/etc/pki/host.com/private/csr.key" \
PROXY_TRANSPORT_TLS_CERT="/etc/pki/host.com/certificates/certificate-fullchain.crt" \
PROXY_HTTP_ADDR="0.0.0.0:8888" \
WEB_HTTP_ADDR="0.0.0.0:8431" \
ocis server

@pasnox pasnox added the Type:Bug label Dec 4, 2022
@pasnox
Copy link
Author

pasnox commented Dec 4, 2022

So, after some investigation, it seems the preview thumbnails used depend the client resolution and how works the thumbnailer by default.
So the thumbnailer by default only generate landscape cropped thumbnails, so if the client size is lower that the image size, you would get a highly truncated image.
To workaround (but not fix it), you can request the thumbnailer to thumbnails also in portrait mode, extending the default

from:
THUMBNAILS_RESOLUTIONS="16x16,32x32,64x64,128x128,1920x1080,3840x2160,7680x4320"

to:
THUMBNAILS_RESOLUTIONS="16x16,32x32,64x64,128x128,1920x1080,3840x2160,7680x4320,1080x1920,2160x3840,4320x7680"

Please add those portrait mode in default, and ensure downscaled instead of cropped is used by the thumbnailer.

@micbar
Copy link
Contributor

micbar commented Dec 5, 2022

@C0rby Can you take a look if this is a bug?

@kulmann
Copy link
Member

kulmann commented Dec 5, 2022

There is a ticket in web for this, see owncloud/web#7728 - but we need some kind of nocrop query option for the thumbnailer service, so that web can request a preview cropped or downscaled as needed.

We intended to have a cropped thumbnail for the file list, but downscaled for the right sidebar Details panel, for the preview app (which shows the images in larger dimensions) and for the upcoming tiles view.

@C0rby
Copy link
Contributor

C0rby commented Dec 5, 2022

Please add those portrait mode in default

You are more than welcome to add the missing resolutions to the default config and open a PR.

and ensure downscaled instead of cropped is used by the thumbnailer.

As @kulmann already stated that was a deliberate decision but we could add a nocrop query parameter.
For that one would need to:

https://pkg.go.dev/github.com/disintegration/imaging#Resize could be used for that since it doesn't crop as opposed to https://pkg.go.dev/github.com/disintegration/imaging#Thumbnail, which we are using right now.

@micbar micbar added Category:Enhancement Add new functionality and removed Type:Bug labels Dec 5, 2022
@micbar
Copy link
Contributor

micbar commented Dec 5, 2022

Removing the bug label because this is an enhancement.

@micbar micbar changed the title Broken thumbnails in images preview Add no-crop thumbnails rendering in images preview Dec 5, 2022
@jacobgkau
Copy link
Contributor

Removing the bug label because this is an enhancement.

This is a blocking issue for resolving a bug (impossible to view a full photo without downloading) in web.

@pasnox
Copy link
Author

pasnox commented Dec 8, 2023

Hi, I just migrated to 4.0.4, and it seems not fixed.
I still have cropped landscape images. Also, you dd not said how I would enable the no-crop mode ?
Can you please give more information ?
Also, just found owncloud/web#9806 claiming to fix it, but does not seems, or not yet in a released version ?
Thanks,

@kulmann
Copy link
Member

kulmann commented Dec 8, 2023

Hi, I just migrated to 4.0.4, and it seems not fixed.
I still have cropped landscape images. Also, you dd not said how I would enable the no-crop mode ?
Can you please give more information ?
Also, just found owncloud/web#9806 claiming to fix it, but does not seems, or not yet in a released version ?
Thanks,

It will be available as part of the ocis v5.0.0 release early next year. There are alpha versions available if you want to check - the web ui utilizes the new option automatically in the preview app. First beta is planned for next Tuesday.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
6 participants