-
-
Save sodabiscuit/c1a351b9318bbbe52de414fe2e7dda6d to your computer and use it in GitHub Desktop.
random_rename_corp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bash | |
# while read p; do | |
# url="${p}?x-oss-process=image/resize,w_1000/quality,Q_60" | |
# wget $url -O ${p##*/} | |
# #sleep .5 | |
# done <./images | |
random_files=`ls ./shop | gshuf -n 6000` | |
unset IFS | |
for f in $random_files; do | |
name=${f##*/} | |
IFS='_' read -r -a array <<< "$name" | |
r1=`echo $RANDOM + 20000 | bc | md5 | cut -c1-15 | tr '/a-z/' '/A-Z/'` | |
#c1=`echo $RANDOM%100 + 1 | bc` | |
crop1=`gshuf -i 70-100 -n 1` | |
#f1="${array[0]}_${array[1]}_${r1}.jpg" | |
f1="${r1}.jpg" | |
cp ./shop/$f ./shop1/$f1 | |
convert ./shop/$f -resize ${crop1}% ./shop1/$f1 | |
#jpegoptim ./shop1/$f1 -m $c1 | |
#cp $f ./shop1/$f1 | |
#mogrigy $f -crop ${crop1}%x${crop1}%+0+0 | |
#echo ${crop1}% | |
#mogrify ./shop1/$f1 -resize ${crop1}% | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment