-
Notifications
You must be signed in to change notification settings - Fork 109
Use public link previews for relative paths #1058
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
Conversation
Signed-off-by: Julius Härtl <[email protected]>
Signed-off-by: Julius Härtl <[email protected]>
|
I tested this as follows:
The relevant part of the html source for the logged in user looks like this <div data-v-336b1e4e="" data-src="photo-1495962637988-4be9db2af01f.jpeg?fileId=10#mimetype=image%2Fjpeg&hasPreview=true" class="image" contenteditable="false" draggable="true">
<div data-v-336b1e4e="" class="image__placeholder">
<div data-v-336b1e4e="" class="image__main" style="">
<a data-v-336b1e4e="" href="/index.php/f/10" target="_blank">
<div data-v-336b1e4e="" class="icon-image" style="background-image: url("/index.php/apps/theming/img/core/filetypes/image.svg?v=0");"></div>
<!---->
</a>
</div>
<div data-v-336b1e4e="" class="image__caption" style="">
<input data-v-336b1e4e="" type="text">
</div>
</div>
</div>So it looks like we ended up in the placeholder branch of the template. The main branch has I suspect that |
azul
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the one adjustment mentioned above this works for me.
the imageUrl function is getting a bit complex and repetetive towards the end.
I suspect replacing the temp previewPath and f with a query / computed property would help here.
| const isPublic = document.getElementById('isPublic')?.value === '1' | ||
| const sharingToken = document.getElementById('sharingToken')?.value | ||
| const previewPath = (!isPublic ? generateUrl('/core/preview.png') : generateUrl('/apps/files_sharing/publicpreview/' + sharingToken)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like the preview.png is what is breaking jpegs for the authenticated user.
Befor i had a 200 request for
http://nextcloud.local/index.php/core/preview?fileId=10&x=1024&y=1024&a=true
now i get a 400 for
http://nextcloud.local/index.php/core/preview.png?fileId=10&x=1024&y=1024&a=true
| const previewPath = (!isPublic ? generateUrl('/core/preview.png') : generateUrl('/apps/files_sharing/publicpreview/' + sharingToken)) | |
| const previewPath = (!isPublic ? generateUrl('/core/preview') : generateUrl('/apps/files_sharing/publicpreview/' + sharingToken)) |
|
Obsolete through #1900 |
Follow up to #1057 to make sure inserted images are accessible if they are in the same or sub directory of a share link