-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Image preview in sharing page should show the full image #7614
Comments
@jancborchardt you wanted to change it to the preview if I remember correctly. |
Ok so a bit of background. Before (when the button was below) this was maybe easier. Previews are always limited in size. (see config.php). The reason for this is that we don't want to generate previews of 20kx20k for huge images etc. The thing is if we redirect to the download link it will not show he image just download it. However if you click on the download link it will still properly download it. I think the reason this behaviour was chosen was so that if people click on the image and just copy the url. It will work properly if they post that to some forum. We server that via a special route that does not do samesite cookie checks etc. However, this is not the case for the download link. Note that I won't change the behaviour for the download link. That will send you the file (not display it) and it will have to be protected by the samesitecookie middleware. Anyway, I don't have a real fix. But this is the reason why. |
I just installed NC 13 beta 3.
|
Already fixed in master
Not currently.
Please report that to the gallery app: https://github.com/nextcloud/gallery |
Ok I'm not sure if I understand. Here's the simplified version of what should happen:
|
No. The behavior before was to download the image. And for good reasons. Now it just opens the preview. Which is also fine with me. However, we will not show the full image there.
|
The behavior was never to download the image when tapping on it. Can we make it so then that when tapping, the full image processed by us will be loaded? So then people can see it bigger. |
@jancborchardt ah you are right it was never download. There was no link on the image. Well that is until you added the link to download to it ;) See: https://github.com/nextcloud/server/pull/6652/files#diff-f2e13306e758275374ea68815da8af04R119 We won't show the full image here. Because that would mean we have to fully process (and store) each image. So you effectively duplicate your used storage. And it adds the issue that you still download a 30 mb picture. What i think might make sense here:
|
Huh, initially the click to view full size worked though? Must have been a subsequent change. Both your suggestions on how to go forward are good! :) |
PR to increase the preview size in #7731 |
PR to bring back touch to zoom in #7734 |
We have a bigger default preview now. I think this should solve most of the issues. If not then we have to think how to do this properly in some later release. |
In the sharing page (go to the Files app, open the right sidebar for a file, open the Sharing tab, click on Share link and open that link in the browser) generally a download button is shown below the preview of the shared file. That button is hidden when the preview URL and the download URL are different, that is, when the shared file is an image. In this case clicking on the preview of the shared file directly shows the full preview of the image in the browser itself, without triggering a download and without showing the rest of elements of the page. The preview URL is used too in the Direct link shown in the menu of the sharing page.
The problem is that when the full preview is generated its size ends limited to certain maximum value, even if the preview is requested with a width and height of
-1
. If the image is larger than the maximum preview size then a scaled down version instead of the full image would be shown. This is specially bad when the image is a rectangle with a large width and a small height or vice versa (for example, if you are sharing a screenshot of a full "tall" web page like https://nextcloud.com/news/); from a user point of view it just seems broken to click on the preview of the image in the sharing page and get a larger preview but still not a full image.An option would be to either show the full preview of the image or directly download it based on the size of the image. If the image is smaller than the maximum preview size, then preview it. If not, then use the
downloadURL
as thepreviewURL
, which would cause the download button to be shown, the download URL to be shown as the Direct link, and the image to be downloaded when clicking on its preview. However it could be confusing for users that sometimes an image is previewed and sometimes it is downloaded (although I think that it would still be better than the current behaviour).In my opinion the proper behaviour would be to show the full image when accessing the preview URL of a shared image. The only difference between the download URL and the preview URL in this case would be in the headers returned on the HTTP response, which would cause the browser to either download or directly show the image.
Requesting the download URL and then altering the headers through JavaScript to make the browser show the image instead of downloading it is not a valid solution, not only because it would be a dirty hack :-P , but because it would apply when clicking on the preview, but not when accessing the direct link.
This should be solved on the server, either by extending the preview API (which would probably be complex) or by changing the implementation of
directLink
inPublicPreviewController
, which is the method called when the preview URL is used, and which I suppose that would be easier; cc'ing @rullzer as the author of #6599 :-)@nextcloud/designers Thoughts on all this?
The text was updated successfully, but these errors were encountered: