Skip to content

Instantly share code, notes, and snippets.

@kidapu
Last active December 7, 2019 07:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kidapu/94f3fcd7d33d2ce541ee96540eff60b8 to your computer and use it in GitHub Desktop.
Save kidapu/94f3fcd7d33d2ce541ee96540eff60b8 to your computer and use it in GitHub Desktop.
リサイズするとき便利だよ
count=0
for inpath in `\find /Volumes/20190915/bb -name '*.JPG' `; do
outpath=${inpath/bb/dd}
echo "- - - - - - - -"
if [ $((count%4)) = 0 ] ; then
echo $inpath
echo $outpath
echo $count
mv $inpath $outpath
fi
# convert -resize 1000x $inpath $outpath
# mv $inpath $outpath
count=$((count + 1))
done
 #!/bin/sh
resize2 () {
for inpath in `\find ./191004_illust/2_thumbnail -name '*.jpg' -or -name '*.png' `; do
outpath=${inpath/191004_illust/191004_illust_resize}
echo "- - - - - - - -"
echo $inpath
echo $outpath
# echo $outpath
convert $inpath -resize 488x $outpath
done
}
resize3 () {
for inpath in `\find ./191004_illust/3_shitagaki -name '*.jpg' -or -name '*.png' `; do
outpath=${inpath/191004_illust/191004_illust_resize}
echo "- - - - - - - -"
echo $inpath
echo $outpath
# echo $outpath
convert $inpath -resize 1918x $outpath
# convert $inpath -quality 100 $outpath
done
}
# main
case $1 in
# "resize1") resize1;;
"resize2") resize2;;
"resize3") resize3;;
*) echo "引数を指定して下さい";;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment