The Archives

  • 23.Jan.09
    Space for shell | pfortuny | (5)
    So your friend sent you a batch of tiffs to be converted into jpg's (using ImageMagick's convert command). However your friend (who is not so geeky as you) uses spaces in filenames (which is a deadly sin), like in First photo of birthday.tiff Second photo.tiff You wanted to use a shell for loop, but the obvious $ for i in `find . -name *tiff` ; do convert "$i" "${i%tiff}jpg" ; done produces garbage (try it). This is just one of the consequences of your friend's carelessness. But there is a solution. IFS (Internal Field Separator) is a shell variable controlling what character(s) delimit a 'field' in ...
  • 05.Jan.09
    Thumbnails cmd | fernape | (2)
    Easy and fast way for creating thumbnails: $ for fich in *.jpg;do convert "$fich" -resize 32x32 thumb_"$fich";done
  • 14.Dec.08
    Dealing with images cmd, shell | fernape | (0)
    It is usual to think it is not possible to deal with images if we work from the command line. However convert, part of the ImageMagick suite is able to do a great job. Example $ convert file.gif file.jpg Converts from GIF to JPG format.
  • 03.Sep.08
    Taking screenshots cmd | fernape | (0)
    $ import -window root screenshot.jpg Takes a shot of the whole desktop and saves it in screenshot.jpg. import is part of the ImageMagick suite.