aboutsummaryrefslogtreecommitdiff
path: root/convert/imgconv
diff options
context:
space:
mode:
Diffstat (limited to 'convert/imgconv')
-rwxr-xr-xconvert/imgconv46
1 files changed, 46 insertions, 0 deletions
diff --git a/convert/imgconv b/convert/imgconv
new file mode 100755
index 0000000..3ac8bc5
--- /dev/null
+++ b/convert/imgconv
@@ -0,0 +1,46 @@
+#!/bin/bash
+
+#sem dodelat err
+
+adresar=$@
+
+mkdir ./web-gallery
+mkdir ./web-gallery/thumbs
+mkdir ./web-gallery/lq
+mkdir ./web-gallery/mq
+mkdir ./web-gallery/hq
+mkdir ./web-gallery/zip #used for image tarballs
+mkdir ./web-gallery/comments
+
+i=1
+for soubor in $adresar
+ do
+ echo "konvertuji $soubor"
+# IMAGEMAGICK
+ #convert -geometry 160x120 -colors 16 -dither $soubor ./web-gallery/thumbs/img-$i.png
+ convert -geometry 120x120 $soubor ./web-gallery/thumbs/img-$i.jpg
+ convert -geometry 640x480 $soubor ./web-gallery/lq/img-$i.jpg
+ convert -geometry 800x600 $soubor ./web-gallery/mq/img-$i.jpg
+
+# NETPBM
+ #jpegtopnm $soubor > temp.pnm
+ ##cat temp.pnm | pnmscale -xysize 120 120 | ppmquant -floyd 16 | pnmtopng -interlace -compression 9 > ./web-gallery/thumbs/img-$i.png
+ #cat temp.pnm | pnmscale -xysize 120 120 | ppmtojpeg --quality 80 --progressive > ./web-gallery/thumbs/img-$i.jpg
+ #cat temp.pnm | pnmscale -xysize 640 640 | ppmtojpeg --quality 80 --progressive > ./web-gallery/lq/img-$i.jpg
+ #cat temp.pnm | pnmscale -xysize 800 800 | ppmtojpeg --quality 80 --progressive > ./web-gallery/mq/img-$i.jpg
+ #rm temp.pnm
+
+ cp $soubor ./web-gallery/hq/img-$i.jpg
+ # template for comment
+ echo "<span>image $i</span> " > ./web-gallery/comments/$i.txt
+ i=`expr $i + 1`
+done
+
+#####################
+# Tar-up/zip images #
+#####################
+
+#tar cvjf web-gallery/zip/mq.tar.bz2 mq/*.jpg
+#tar cvjf web-gallery/zip/hq.tar.bz2 hq/*.jpg
+zip -R web-gallery/zip/mq.zip web-gallery/mq/*.jpg
+zip -R web-gallery/zip/hq.zip web-gallery/hq/*.jpg