nextcloud/files_photospheres

Improve the way to determine if the image is a PANO

Closed this issue · 13 comments

R0Wi commented

Currently the app only shows the viewer if the image-name is prefixed with "PANO_". Remove this limitation and provide a way to efficiently read the xmp-data of a file.

This will remove to limitations:

  • Files need not to have any special filename

  • The image won't be loaded twice. (Currently pano-images are loaded twice by the browser. The first time to read the xmp-data, the second time to show the image)
    pano

j-ed commented

@R0Wi Is there a way to check the result of the new server-side check? I've selected a pano image taken with a Galaxy S7 phone but I couldn't see any differences how the image is displayed, compared to other e.g. jpg images.

R0Wi commented

@j-ed if you open the network-tab from your devtools there should be a request like "<YOUR_NC_BASE_URL>/index.php/apps/files_photospheres/files/xmpdata/<FILE_ID>" after clicking on an jpg-image. This request checks whether the image is a regular jpg file or if it contains xmp-data and therefore decides, if the pano viewer or the default viewer for images will be opened.

If you use NC16 please also ensure that you disable the "Viewer"-app, which is enabled by default. We're working on an integration, please refer to #7 for further details.

j-ed commented

@R0Wi Thank you. Unfortunately I could find the mentioned request in the network-tab of my browser devtools, nor am I able to view a panorama image in NC 16.0.1 although I've deactivated the viewer app (only the image download is possible). So I will wait some more time until the viewer integration has been finished.

R0Wi commented

Okay that's strange. If you can't see the request i mentioned, it means that the clickhandler is not executed properly. So the click event is not brought to our clientside code.
Or am i getting you wrong? You CAN'T see the request, right?

j-ed commented

I'm using FF 67.0.2 to access NC 16.0.1. The viewer app has been disabled and the photosphere app enabled. As requested, I've opened the network analysis (Netzwerkanalyse) under the developer tools, before I navigated to the folder containing the panorama image. Once I click on the image, a download dialog is shown instead of a preview. No other image can be viewed either.
Unfortunately I cannot see any reference to the files_photospheres app in the network analysis tool.

Right after I reactivate the viewer app, I can at least view the panorama images as a normal jpg file again.

R0Wi commented

Ok seems like the clientside scripts are not injected properly in your instance. I've tested it with the current version (1.0.1) and FF 67.0.2 and i can see at least 2 js-files in the sources tab.
tmp

I believe you can't see them, right? Could you have a look at your NC-error log ?

j-ed commented

Ok, I can confirm that these two js-files are loaded:

grafik

The NC log file doesn't show any related entries and this is the download dialog which is shown when clicking on a pano image:

grafik

R0Wi commented

Ok at least the clientside js-files are there. Seems like the click-handler is not working properly for you.

Could you just try to enable the "Gallery"-app, so that at least the "normal" jpg-files are opened there? Could be that there is a problem if there's no filehandler registered for jpg-files.

j-ed commented

Good news, as soon as I reactivate the Gallery app (the Viewer app is still disabled) I can view all kind of images, Normal 2d-panorama images are displayed as normal jpg files and, 3d-panorama images are shown correctly by your Photo Sphere app now.
I think you should point-out, that the app is only used 3d-panorama images, not normal ones. I ran into that trap too, at the beginning.

R0Wi commented

Nice to hear, so if i get you right it could be a bug: when the viewer-app is disabled and the gallery-app is also disabled the photosphere-viewer doesn't work correctly. So i will check that an give you a quick response.

Refering to you 2d/3d-images: we only provide a integration of the photosphere-viewer.js library, so capabillities are limited to that library. We except the files to contain valid XMP-data of a photosphere image. I didn't know that there are actually 2d photosphere-images?

j-ed commented

On a Samsung Galaxy S7, you can choose between two different panorama functions, (1) allows to take 2d-panorama images by e.g. moving the camera from left to right etc., or 3d-panorama images by navigating to specific points in a 3d-sphere. At the beginning I thought both of these panorama images would be supported. No I learned that only the second one is supported 😉

grafik

R0Wi commented

Ah i see, this is indeed misleading :-)

R0Wi commented

Moved bug to #15