Jump to content


From mediawiki.org
Equirectangular projection of 360 photograph
iPhone Panorama photo using cylindrical projection
Stereo (Left, Right) image
Demo video

My attempt at converting the panoviewer toolforge tool by Dschwen into an extension which can be embedded into wiki pages.

Dutch 2023 hackathon

  • Updated the extension (hook handlers, updated dependencies etc)
  • Moved the projections patch into the extension. This should be more maintainable.
  • I'm considering renaming the extension from PanoViewer to MediaProjections. This because panoviewer seems very much focused on 1 style of projections, and I think that with the projection classes in the project, it's better to have a tad more generic name.
  • Still have to work on the magicword parsing for panorama's
  • It seems that stereoscopy (VR) is actually harder now than in 2019, the libraries are all very unstable honestly. Might not be possible to add this any time soon.

Dutch 2022 hackathon


Step 1

  • Create an extension for panoviewer which adds the JS modules to the relevant pages.
  • I had started this project before Covid, but had never published it.
  • Cleaned up and now available on the WM gitlab.
  • Repo: https://gitlab.wikimedia.org/hartman/panoviewer

Step 2

  • Allow mediahandlers in core to know about projections and stereoscopy formats
  • Add an attribute to the thumbnails used in wiki pages
    • data-file-projection for a panorama
    • data-file-stereo for a stereoscopy thumbnail
  • Patch for core: https://gerrit.wikimedia.org/r/c/mediawiki/core/+/856040
	<a href="/wiki/index.php/File:Testpano.jpg">
		<img src="/wiki/images/thumb/1/10/Testpano.jpg/300px-Testpano.jpg"
			height="71" />
	<figcaption>Thumbnail of iPhone Panorama photo</figcaption>

	<a href="/wiki/index.php/File:Curtin01.jps">
		<img src="/wiki/images/thumb/7/7b/Curtin01.jps/300px-Curtin01.jps.jpg"
			height="113" />
	<figcaption>Thumbnail with left right stereoscopy</figcaption>

Step 3


Bring it together and have Panoviewer read the metadata on a wikipage and allow a user to load and open the interactive widget

Lessons learned

  • MediaHandling of core is file extension based, not capability based. We should really split MediaRendering off from MediaHandler, so that the handler can use a renderer conditional on the metadata of the file.
  • MultimediaViewer is also file extension based. It cannot have multiple handlers for 1 file type either.
  • This does not do tile rendering for very high resolution panoramas. This is a sad limitation.
  • Thumbnailing for these kinds of resources is hard as you need to warp them and read lots of metadata interpretation. So for now the thumbnails remain the warped originals.
  • Idea (very long term) by Ladsgroup. Create a new webp/avif file format with low and high resolutions thumbnails and tiles for the high resolution projected image. Then the thumbnailer won't have to do warping, and we can stream the tiles without having a server to do tiling and serve up the tiling
  • Standards and naming for all these projections and stereoscopy is all over the place. Hard to figure out.
  • There are a lot of experimental libraries for all kinds of things on the web, but few that handle almost all of the formats.

Thank you


See also: