-
Notifications
You must be signed in to change notification settings - Fork 0
Batch or script generate publishing sphere
fran6t edited this page Oct 23, 2022
·
11 revisions
After obtaining the image of the sphere, directly from the export of the drone, or assembled with hugin from the original jpgs or raw files, the following three scripts can be used, they allow you to obtain a zip with the Good structure.
The steps of these scripts are:
- 1 Creation of a sub -directory of the name of the Sphere with the extension .D
- 2 In the sub-directory .D the creation of a SRC sub-directory and a Thmb
- 3 Copy of the 26 .jpg file in the SRC sub -directory
- 4 Creation of sticker in the THMB Corremy directory at the 26 .jpg files
- 5 creation of a zip that can be uploaded
minidji.sh
#!/bin/sh
# Attention à la casse des noms de fichiers jpg doivent être .jpg et pas .JPG
# Be carefully name of filename jpg must be .jpg not .JPG
filename=$1
filesource="${filename%.jpg}"
echo "mkdir $filesource.d \n"
mkdir "$filesource".d
echo "mkdir $filesource.d/src \n"
mkdir "$filesource".d/src
cp DJI_00* "$filesource".d/src
echo "mkdir $filesource.d/thmb \n"
mkdir "$filesource".d/thmb
mogrify -resize 256x192 -quality 80 -path "$filesource".d/thmb "$filesource".d/src/*.jpg
echo "zip all file \n"
zip -r "$filesource".zip "$filesource".jpg "$filesource".d```
minix8000.sh
#!/bin/sh
filename=$1
filesource="${filename%.jpg}"
file8K="$filesource"8K
file8K4K="$filesource"8K4K
filesmall="$filesource".small.jpg
echo "convert -resize 8848x $1 $file8K div by 128\n"
convert -resize 8448x $1 "$file8K"
echo "convert file8K -gravity south -extent 8448x4224 file8K4K \n"
convert "$file8K" -gravity south -extent 8448x4224 "$file8K4K"
echo "convert $file8K4K -resize 2000x1000 -quality 75 $filesmall \n"
convert "$file8K4K" -resize 2000x1000 -quality 75 "$filesmall"
echo "mkdir $filesource.small.d \n"
mkdir "$filesource".small.d
echo "mkdir $filesource.small.d/tiles \n"
mkdir "$filesource".small.d/tiles
echo "convert $file8K4K -crop 528x528 $filesource.d/tiles/tile_%04d.jpg \n"
convert "$file8K4K" -crop 528x528 "$filesource".small.d/tiles/tile_%04d.jpg
echo "mkdir $filesource.d/src \n"
mkdir "$filesource".small.d/src
cp DJI_00* "$filesource".small.d/src
echo "mkdir $filesource.d/thmb \n"
mkdir "$filesource".small.d/thmb
mogrify -resize 256x192 -quality 80 -path "$filesource".small.d/thmb "$filesource".small.d/src/*.jpg
echo "zip all file \n"
zip -r "$filesource".small.zip "$filesource".small.jpg "$filesource".small.d
echo "Pensez à bien nommer les dji_xxxx.JPG avec .jpg en minuscule avant de lancer ce script"
minix17000.sh
#!/bin/sh
# Attention à la casse des noms de fichiers jpg doivent être .jpg et pas .JPG
# Be carefully name of filename jpg must be .jpg not .JPG
filename=$1
filesource="${filename%.jpg}"
file16K="$filesource"16K
file16K8K="$filesource"16K8K
filesmall="$filesource".small.jpg
echo "convert -resize 16384x $1 $file16K \n"
convert -resize 16384x $1 "$file16K"
echo "convert file16K -gravity south -extent 16384x8192 file16K8K \n"
convert "$file16K" -gravity south -extent 16384x8192 "$file16K8K"
echo "convert $file16K8K -resize 2000x1000 -quality 75 $filesmall \n"
convert "$file16K8K" -resize 2000x1000 -quality 75 "$filesmall"
echo "mkdir $filesource.d \n"
mkdir "$filesource".d
echo "mkdir $filesource.d/tiles \n"
mkdir "$filesource".d/tiles
echo "convert $file16K8K -crop 1024x1024 $filesource.d/tiles/tile_%04d.jpg \n"
convert "$file16K8K" -crop 1024x1024 "$filesource".d/tiles/tile_%04d.jpg
echo "mkdir $filesource.d/src \n"
mkdir "$filesource".d/src
cp DJI_00* "$filesource".d/src
echo "mkdir $filesource.d/thmb \n"
mkdir "$filesource".d/thmb
mogrify -resize 256x192 -quality 80 -path "$filesource".d/thmb "$filesource".d/src/*.jpg
echo "zip all file \n"
zip -r "$filesource".zip "$filesource".small.jpg "$filesource".d
French
Après avoir obtenu l'image de la sphère, directement de l'export du drone, ou assemblée avec hugin a partir des jpg d'origines ou des fichiers raw les trois scripts suivants peuvent être utilisés ils permettent d'obtenir un zip avec directement la Bonne structure.
Les étapes de ces scripts sont :
- 1 création d'un sous repertoire du nom de la sphere avec l'extension .d
- 2 dans le sous repertoire .d la creation d'un sous repertoire src et d'un sous-repertoire thmb
- 3 copie des 26 fichier .jpg dans le le sous repertoire src
- 4 creation de vignette dans le repertoire thmb correpondan aux 26 fichiers .jpg
- 5 creation d'un zip pouvant être uploader