mpetroff / pannellum

Pannellum is a lightweight, free, and open source panorama viewer for the web.
https://pannellum.org/
MIT License
4.3k stars 728 forks source link

Feature request: improve generate.py to automatically extract Google Photo Sphere metadata for partial equirectangular panoramas #957

Open bandrews opened 3 years ago

bandrews commented 3 years ago

Currently, if an image is a partial panorama, generate.py will throw an error unless the -vaov, -haov and -vOffset parameters are provided.

Many equirectangular images of partial panoramas actually have correct Google Photo Sphere XMP metadata embedded that could be used to calculate these values. Ideally, generate.py should be capable of extracting this information automatically. (Pannellum itself does a great job of it!)

This feature request wouldn't be a huge deal if you could just extract the metadata with an exif reader and manually supply the values, but it's more complicated than that - the Google metadata stores the information differently, so the formulas in https://github.com/mpetroff/pannellum/blob/652194695e042db31cb8fb8531f65c40b127768d/src/js/pannellum.js#L607 are needed to convert to the parameters that Pannellum uses. So non-developers might not be able to connect all the dots to figure out how to generate the right input pieces.

If integrating a library that can extract EXIF data is too burdensome or undesirable, an alternative suggestion would be to add command line parameters that can accept the relevant Photo Sphere metadata elements directly...

Thanks in advance!

Tweak4141 commented 1 year ago

I'd like to see this feature added, it would be great to have.