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

Viewing shared images full sized are cropped #448

Closed
jhesketh opened this issue Mar 31, 2020 · 8 comments · Fixed by #449
Closed

Viewing shared images full sized are cropped #448

jhesketh opened this issue Mar 31, 2020 · 8 comments · Fixed by #449
Labels
3. to review Waiting for reviews bug Something isn't working

Comments

@jhesketh
Copy link

Describe the bug
When opening an image that has been shared the full sized version is cropped. I believe it is just missing the preserve aspect ratio option. (This is possibly because the thumbnails do not preserve aspects).

To Reproduce
Steps to reproduce the behavior:

  1. Share a link for a folder with images
  2. Open any image in the viewer
  3. The image will be incorrectly cropped (particularly noticeable for portrait photos)

Expected behavior
Thumbnails should be cropped (or at least have an option as per nextcloud/photos#143), and are. However when clicking on an image to view we should be able to see the full image.

Screenshots
(Can add along with more details if needed, but hopefully the above is enough).

@skjnldsv
Copy link
Member

Hey!
Can you post the image here as well as a screenshot of what is happening please?

@jhesketh
Copy link
Author

jhesketh commented Mar 31, 2020

Using this sample (original size):
https://www.flickr.com/photos/giuseppemilo/27300605837

When opening the file as my nextcloud user (authenticated/not as a share):
auth

When opening the file from a shared link:
public

Note that the image in a public link is cropped more like landscape (whereas the original is portrait) missing the top parts of the tree in the foreground.

The private URL is:
https://HOST/index.php/core/preview?fileId=460572&x=1600&y=900&a=true

The public URL is:
https://HOST/index.php/apps/files_sharing/publicpreview/gQwoSCmqGosieHP?fileId=460572&file=/27300605837_730ccd80e3_o.jpg&x=1920&y=1080

Note the a=true is missing from the public URL forcing the image into the wrong aspect ratio. (EDIT: adding a=true to the URL renders the image correctly. Although I haven't tested this in the viewer, just as a direct link).

The thumbnails in both cases are cropped to squares, but this is likely expected functionality (again tracked in nextcloud/photos#143).

@skjnldsv
Copy link
Member

That is an issue indeed!
Moving to viewer! 🚀

return generateUrl(`/apps/files_sharing/publicpreview/${getToken()}?fileId=${fileid}&file=${filename}&x=${screen.width}&y=${screen.height}`)

@skjnldsv skjnldsv transferred this issue from nextcloud/photos Mar 31, 2020
@skjnldsv skjnldsv added 3. to review Waiting for reviews bug Something isn't working labels Mar 31, 2020
@jhesketh
Copy link
Author

Ah, that's why I couldn't find it. I was only grepping this repo. Thanks!

@skjnldsv
Copy link
Member

All good :)
Thanks a lot for reporting!

You're testing the 18.0.4 beta? Or you're having a test instance with 19?

@jhesketh
Copy link
Author

This is still running from a daily build (master) that is a few days old. (I'll likely use stable when 19 is released).

@skjnldsv
Copy link
Member

Nice! Thanks for helping on the tests phases! 🚀

@jhesketh
Copy link
Author

Of course. Thanks for all your work+help and super speedy fixes! :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants