scripts

random scripts
git clone https://git.parazyd.org/scripts
Log | Files | Refs

quinq-size (428B)


      1 #!/bin/bash
      2 
      3 if [ $# -lt 1 ];
      4 then
      5 	printf "usage: %s -|img [img ...]\n" "$(basename "$0")" >&2
      6 	exit 1
      7 fi
      8 
      9 function toquinqsize {
     10 	filename="$1"
     11 	output="${filename%.*}_quinqsize.${filename##*.}"
     12 	convert "$filename" -resize 1024 "${output}";
     13 	printf "%s -> %s\n" "${filename}" "${output}";
     14 }
     15 
     16 if [ "$1" = "-" ];
     17 then
     18 	while read -r file;
     19 	do
     20 		toquinqsize "$file"
     21 	done
     22 else
     23 	for i in "$@";
     24 	do
     25 		toquinqsize "${i}"
     26 	done
     27 fi
     28