nextcloud / files_photospheres

Nextcloud app for viewing Google PhotoSphere 360° images (panorama-images)
GNU Affero General Public License v3.0
29 stars 2 forks source link

Integrate into viewer #27

Open skjnldsv opened 5 years ago

skjnldsv commented 5 years ago

Hey!

Awesome app :) On 16 we integrated the new universal viewer https://github.com/nextcloud/viewer/ Ideally your ui should integrate itself into it.

Do you see any possible issues? Could we work towards this outcome? Can I be any help? :)

R0Wi commented 5 years ago

Hi @skjnldsv,

i would really appreciate a proper integration. At the moment i don't see any risks to do this. The only thing which has to be mentioned is that the app isn't just the viewer component. It has also a little serverside part, which (at the moment) checks if the clicked image is a "normal" image or a photosphere image. Even if the check is quite fast it needs a little time to determine which viewer to show. So i'd suggest to keep the integration configurable so that the user (nextcloud admin) can decide, if he want's that feature or not.

Regarding the integration i've taken a look into your documentation on "how to add your own file view" a few weeks ago. But i'm not quite familiar with Vue.js so maybe you could give a minimal example on how to hook into the file click event, if a "image/jpeg" has been clicked? This is the point where we have to hook into and check if the image is a pano or not :-)

Features like "switching between panorama images" (#11) aren't implemented yet. So the integration would initially just cover a handler for a click on an image.

skjnldsv commented 5 years ago

Okay :) Let's do it step by step! How do you detect if a file is a panorama? Size + ratio? Metadata? Your app does some php it seems, why exactly is this needed?

R0Wi commented 5 years ago

So currently the app works like this: it hooks into the clientside click event for the mimetype "image/jpeg". If an image is clicked, a serverside script is invoked, which reads the first few bytes of the image file and scans for the XMP-data tags (metadata for pano files). If it finds the data, the tag values are returned via json and the client invokes the panoviewer with this metadata. If not the defaultviewer is invoked.

skjnldsv commented 4 years ago

Ah yes, we would need special hook since I'm guessing the mimetype is still set to image/jpg or whatever ?

R0Wi commented 4 years ago

Well as far as i know pano-images are just "normal" jpeg's with a bit of metadata at the beginning of the file. So yes the mime-type is "image/jpeg" which is listed in the files-view. Do you think we should introduce a special mime-type for pano-images so that its clear to divide normal jpeg's and panos on clientside?

skjnldsv commented 4 years ago

Not sure we can trick dav into creating its own mimetype. I think we should rather improve how we register files actions in viewer and files for such cases. I'm sure we will find other similar issues :)

R0Wi commented 4 years ago

I know about an app registering it's own mimetype (https://github.com/jhass/nextcloud-keeweb). But of course it would be nice if we find another solution for this. Maybe we could add an additional attribute to the javascript-file-object or something like this?

SKB-CGN commented 1 year ago

This would be really great, if the viewer would change, when swiping through the pictures.