aboutsummaryrefslogtreecommitdiff
path: root/convert/imgconv
diff options
context:
space:
mode:
authorjimmacfx <jimmacfx@4fa712ea-3c06-0410-9261-c11b4c06c003>2005-11-25 22:16:10 +0000
committerjimmacfx <jimmacfx@4fa712ea-3c06-0410-9261-c11b4c06c003>2005-11-25 22:16:10 +0000
commit4023001a68b3d85891ab744eb77e7b22a9dd8e3f (patch)
tree8ef9fadd91e07cae3bcc1284cc06a850f818168b /convert/imgconv
parent796ade427c4b26271d879d2c1f58def958d51568 (diff)
downloadoriginal-4023001a68b3d85891ab744eb77e7b22a9dd8e3f.tar.gz
original-4023001a68b3d85891ab744eb77e7b22a9dd8e3f.tar.bz2
import original 0.11
git-svn-id: https://forgesvn1.novell.com/svn/original/trunk@2 4fa712ea-3c06-0410-9261-c11b4c06c003
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