Driftnet – misc scripts

#!/bin/bash
mpixW=250
mpixH=300
if [ "x`which identify`" != x ] ; then
  echo `which identify` found!
  echo Tossing images less than $mpixW pixels.
  while true ; do
    read img
	imgType=$( expr `identify -format '%e' "$img"` )

	if [ "$imgType" == "jpeg" ] ; then

    sizeW=$( expr `identify -format '%w' "$img"` )
	sizeH=$( expr `identify -format '%h' "$img"` )
    echo $sizeW"x"$sizeH
    if [ $sizeW -lt $mpixW ] ; then
      echo "R: "$sizeW"x"$sizeH - $img
      rm "$img"
	else
	  echo "A: "$sizeW"x"$sizeH - $img
	  mv "$img" /root/dnet
    fi

	else
		echo "T: "$sizeW"x"$sizeH - $img
		rm "$img"
	fi
  done
fi

, ,

No comments yet.

Leave a Reply

*

Powered by recycled bites and bytes.