Spent the morning working on this, so I thought I’d share
- Photo needs to be landscape orientation with at least a 2:1 ratio.
- Uploading in high resolution is best. It appears that Facebook disables downloading in 360 view mode, so your high resolution version should be safe, but I can’t guarantee it.
- Photo metadata needs to describe it as a panorama (you can use my code below)
- You’ll need exiftool (available here http://www.sno.phy.queensu.ca/~phil/exiftool/)
- Should work on Linux, Mac and Windows
#!/bin/bash
file=$*
echo -n 'Horizonal View in degrees (100-360): '
read hor_view
width=`exiftool -S -ImageWidth "$file" |cut -d' ' -f2`
height=`exiftool -S -ImageHeight "$file" |cut -d' ' -f2`
let width_full=$((360*$width/$hor_view))
let height_full=$((180*$width_full/$hor_view))
let height_full=$(($width_full/2))
let left_crop=$((($width_full-$width)/2))
let top_crop=$((($height_full-$height)/2))
exiftool -FullPanoWidthPixels=$width_full \
-FullPanoHeightPixels=$height_full \
-CroppedAreaLeftPixels=$left_crop \
-CroppedAreaTopPixels=$top_crop \
-CroppedAreaImageWidthPixels=$width \
-CroppedAreaImageHeightPixels=$height \
-ProjectionType=equirectangular \
-UsePanoramaViewer=True \
"$file"