Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion spatialmedia/metadata_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ def inject_metadata(src, dest, metadata, console):
console("Unknown file type")


def generate_spherical_xml(projection="equiretangular", stereo=None, crop=None):
def generate_spherical_xml(projection="equirectangular", stereo=None, crop=None):
# Configure inject xml.
additional_xml = ""
if stereo == "top-bottom":
Expand Down
12 changes: 12 additions & 0 deletions spatialmedia_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,18 @@ def test_inject_v2_rectangular_top_bottom(self):
self.assertTrue(contents.find('Stereo Mode: 1') >= 0)


class TestGenerateSphericalXml(unittest.TestCase):
def test_default_projection_is_equirectangular(self):
"""Default projection must match the equirectangular comparison string."""
xml = metadata_utils.generate_spherical_xml()
self.assertIn('equirectangular', xml)
self.assertIn('<GSpherical:Spherical>true</GSpherical:Spherical>', xml)

def test_none_projection_is_not_spherical(self):
xml = metadata_utils.generate_spherical_xml(projection='none')
self.assertNotIn('equirectangular', xml)
self.assertIn('<GSpherical:Spherical>false</GSpherical:Spherical>', xml)

if __name__ == '__main__':
try:
os.mkdir('test_output')
Expand Down