Setup Pannellum generate panorama script in Docker in MacOS
Selasa, 31 Oktober 2023, 9:35 am0
Pannellum (https://pannellum.org/) is the JS library I use to host panoramic images in this blog, tagged under #panorama360. Before this I generate the multi resolution images on my Thinkpad ⁽¹⁾ or Mac Mini, and it’s been over 2 years since I setup those. I need to setup the generate script in my Macbook Air ⁽²⁾ since it’s my main #laptop for blogging.
- Install Docker for Mac (https://docs.docker.com/desktop/install/mac-install/). Download the
.dmg
file, after done, mount it & drag the #Docker app into Application folder. - Check docker command in Terminal,
which docker
, it should exist in/usr/local/bin/docker
- By referring documentation at https://github.com/mpetroff/pannellum/tree/master/utils/multires
- get
Dockerfile
&generate.py
, and put them in one folder.
- get
- Build docker container
- using Terminal, go to the folder containing
Dockerfile
&generate.py
files. - run
docker build -t generate-panorama .
- using Terminal, go to the folder containing
- Add
generate_panorama
as alias in~/.zshrc
alias generate_panorama='f() { docker run -it -v $PWD:/data generate-panorama --output /data/output /data/$1; cd output; zip -r ../$1.zip *; cd ..; rm -fr output };f'
- To use this command:
cd folder
generate_panorama 01.jpg
, this will generate01.jpg.zip
file
⁽¹⁾ https://azwan082.my/2021/03/bukan-hadiah-krismas-tapi-jadi-hadiah-birthday-pulak-thinkpad-x260-/
⁽²⁾ https://azwan082.my/2023/04/pinky-sungguh-macos-monterey/
Layan movie Jerman kat saluran MCE di MyTV
1 November 2023
Sultan JDT akan jadi Agong ke-17
30 Oktober 2023