Skip to content

Commit

Permalink
Option to resize down images (see .conf files) #61
Browse files Browse the repository at this point in the history
  • Loading branch information
filipsPL committed Jan 19, 2019
1 parent 1a9df73 commit 599f6ef
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 2 deletions.
3 changes: 3 additions & 0 deletions modules/meteor-m2/meteor.conf.example
Expand Up @@ -13,3 +13,6 @@ meteorDir="$recordingDir/meteor/"

# directory where the images finally will go
imgdir="$meteorDir/img/"$(date +"%Y/%m/%d/")

# resize images to the given size to avoid growing of the repository; in px
resizeimageto=1024
17 changes: 17 additions & 0 deletions modules/meteor-m2/meteor_gallery.sh
Expand Up @@ -42,6 +42,19 @@ echo $wwwPath/$fileNameCore > $wwwDir/meteor-last-recording.tmp

cd $rawImageDir

#
# should we resize images?
#

if [ "$resizeimageto" != "" ]; then
echo "Resizing images to $resizeimageto px"
mogrify -resize ${resizeimageto}x${resizeimageto}\> *.jpg
fi

#
# loop over images and generate thumbnails
#

for obrazek in *.jpg
do
echo $obrazek
Expand All @@ -54,7 +67,11 @@ do
done




#
# move images to their destination
#

mv $rawImageDir/* $imgdir/
# cp $rawImageDir/* $imgdir/
Expand Down
4 changes: 4 additions & 0 deletions modules/noaa/noaa.conf.example
Expand Up @@ -26,3 +26,7 @@ dongleIndex='0'

# enchancements to apply to the pocessed images. See wxtoimg manual for available options
enchancements=('MCIR-precip' 'HVC' 'MSA' 'therm' 'HVCT-precip' 'NO')

# resize images to the given size to avoid growing of the repository; in px
# otherwise, comment out the line
resizeimageto=1024
14 changes: 12 additions & 2 deletions modules/noaa/noaa_process.sh
Expand Up @@ -10,15 +10,25 @@
#
wxmap -T "$satellite" -a -H $tleFileName -o -O $duration -L "$latlonalt" $start $imgdir/$fileNameCore-mapa.png | tee -a $logFile

#
# should we resize images?
#

if [ "$resizeimageto" != "" ]; then
echo "Resizing images to $resizeimageto px"
resizeSwitch="-resize ${resizeimageto}x${resizeimageto}\> *.jpg"
fi

#
# process wav file with various enchancements
#

for enchancement in "${enchancements[@]}"
for enchancement in "${enchancements[@]}"
do
echo "**** $enchancement"
# wxtoimg -e $enchancement $recdir/$fileNameCore.wav $imgdir/$fileNameCore-${enchancement}.png | tee -a $logFile
wxtoimg -e $enchancement -m $imgdir/$fileNameCore-mapa.png $recdir/$fileNameCore.wav $imgdir/$fileNameCore-${enchancement}+map.png | tee -a $logFile
convert -quality 93 $imgdir/$fileNameCore-${enchancement}+map.png $imgdir/$fileNameCore-${enchancement}+map.jpg
convert -quality 91 $resizeSwitch $imgdir/$fileNameCore-${enchancement}+map.png $imgdir/$fileNameCore-${enchancement}+map.jpg
rm $imgdir/$fileNameCore-${enchancement}+map.png
done

Expand Down

0 comments on commit 599f6ef

Please sign in to comment.