Photo Sphere Viewer supports cropped panorama given the appropriate configuration is provided. Cropped panoramas are not covering the whole 360°×180° sphere area but only a smaller portion. For example you might have a image covering 360° horizontally but only 90° vertically, or a semi sphere (180°×180°)
These incomplete panoramas are handled in two ways by Photo Sphere viewer:
- Read XMP metadata directly from the file (with the
- Provide the
Use the Playground at the bottom of this page to find the best values for your panorama.
In both case the data contains six important values:
- Full panorama width
- Full panorama height
- Cropped area width
- Cropped area height
- Cropped area left
- Cropped area right
The Full panorama width / Full panorama height ratio must always be 2:1, Cropped area width and Cropped area height are the actual size of your image, Cropped area left and Cropped area right are used to define the cropped area position.
More information on Google documentation.
If you created your panorama with a mobile phone or dedicated 360° camera, it should already contain the correct XMP data. Otherwise you can inject it yourself with tools like exiftool.
The XMP payload is as follow:
To write the XMP data to an image file, copy-paste in a text file and use this command:
You can also directly pass the six values to Photo Sphere Viewer with the
Use this demo to find the best values for your image.