added loop to do sth in each folder
This commit is contained in:
13
README.md
13
README.md
@@ -7,3 +7,16 @@ Collection of notes
|
|||||||
```mogrify``` overwrites existing images which is what makes it different from ```convert```
|
```mogrify``` overwrites existing images which is what makes it different from ```convert```
|
||||||
#### cut poly-shape out of image, crop image to its boundaries, fill surrounding holes in certain color or transparent (for all jpgs in folder)
|
#### cut poly-shape out of image, crop image to its boundaries, fill surrounding holes in certain color or transparent (for all jpgs in folder)
|
||||||
```for f in ./*.jpg; do convert "$f" \( -clone 0 -fill black -colorize 100 -fill white -draw "polygon 3276,2421 4945,2407 4956,4708 3287,4722" \) -alpha off -compose copy_opacity -composite -trim +repage 41050648/"$f"_left.jpg; done```
|
```for f in ./*.jpg; do convert "$f" \( -clone 0 -fill black -colorize 100 -fill white -draw "polygon 3276,2421 4945,2407 4956,4708 3287,4722" \) -alpha off -compose copy_opacity -composite -trim +repage 41050648/"$f"_left.jpg; done```
|
||||||
|
#### do something inside each folder of this folder
|
||||||
|
```
|
||||||
|
for d in */; do
|
||||||
|
cd $d;
|
||||||
|
for dir in */; do
|
||||||
|
for frontpage in "$dir"*.jpg; do
|
||||||
|
echo convert "$frontpage" -resize 500x500 "$frontpage"_500px.jpg
|
||||||
|
break 1
|
||||||
|
done
|
||||||
|
done
|
||||||
|
cd ..;
|
||||||
|
done
|
||||||
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user