Skip to main content
Buat HTML Thumbnails guna command line

Saja jek,coz saya nak create html thumbnails guna digikam,tak nampak lak plugin tu kluar even dah emerge on Gentoo.

Short cut,guna command line bash saja,dengan syarat imagemagick dah diemerge.

katakan saya ada berpuluh-puluh fail JPG dan nak letak pada laman web,

buat satu direktori,

mkdir th


buat thumbnail:

for i in *.jpg; do convert -sample 25%x25% $i th/$i ; done


buat html thumbnail:


for i in *.jpg ; do echo " src=\""th/$i\"">" >> index.html; done



(kena escape " dengan \" kalau tak readable oleh for loop).
digikam punya html plugin tak jalan,terpaksa guna CLI.


siap!

Comments

Anonymous said…
aku guna igal jer. mula2 memang plan nk buat camni tapi igal is better. :)
0xff said…
igal pun actually needs imagemagick as dependencies :-)

kalau guna digikam punya actually much better i guess.

anyway,aku pun tengah emerge igal,thanx for point it out. :-)
Marjan Jeffry said…
nie solution python aku linuxlah python 4 mnajem
Anonymous said…
>igal pun actually needs imagemagick as dependencies :-)
nvm ... imagemagick memang dah lama ada kt system aku. tapi aku takder PIL, sebab tu aku suka igal. satu sebab lagi aku tak payah buat coding. org malas memang camni. jangan tiru aku. python rock ! :)
Marjan Jeffry said…
Yes python rock :p ... tapi any solution pun rock asalkan boleh jalan

Popular posts from this blog

Gue dengan S2 gue. Sronok banget!
Beijing and image manipulation addict Salam, Image manipulation with command line is fun and time consuming too. Given my Digikam plugins unable to work, I start to figure out many wonderful features of other tool which offer almost the same quality. However I was stucked with ImageMagick,with many tutorial on the net: Here and Here for i in *jpg ;do convert -font helvetica -fill white -pointsize 18 -draw 'text 10,50 "ACM-ICPC Beijing 2005"' $i $i;done The pix above shows a heater to heat up guest room during ACM-ICPC competition. (outside building's temperature is almost 4 celcious).