Last active
August 3, 2022 12:14
-
-
Save fernandomr/c096fb42a51fbcf44201d3bdb8b02242 to your computer and use it in GitHub Desktop.
Revisions
-
fernandomr revised this gist
Aug 3, 2022 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -35,7 +35,7 @@ for dir in "${arrayOfDirs[@]}"; do # fileAbsolutePath=$FOLDER$dotSlash$aux # echo "$fileAbsolutePath"; echo "--processing $aux"; convert $aux -verbose -resize $WIDTHx$HEIGHT $aux done fi -
fernandomr created this gist
Aug 3, 2022 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,43 @@ # absolute path to image folder FOLDER="" # max width WIDTH=620 # max height HEIGHT=620 cd prods/ # it is array of dirs already arrayOfDirs=(*/) # loop trough dirs for dir in "${arrayOfDirs[@]}"; do echo "entering $dir"; cd $dir; # FOLDER=$(pwd); # get files bigger than 640kb arqs=( $(find ./ -maxdepth 1 -type f -size +640k) ) numOfFiles=${#arqs[@]} # echo "num of files: $numOfFiles" if [ $numOfFiles > 0 ]; then for fileItem in ${arqs}; do # echo "$fileItem"; # mount file absolute path aux=${fileItem##*/} # fileItem is in format "./2938230982309823.png". This cuts after './' dotSlash="/" # fileAbsolutePath=$FOLDER$dotSlash$aux # echo "$fileAbsolutePath"; echo "--processing $aux"; convert $aux -verbose -resize 620x620 $aux done fi cd .. done