I have subfolders in current directory like this:
ls
apples bananas oranges potatoes
Each subfolder includes different number of .jpg images.
cd apples
ls
000000522638.jpg 000000522713.jpg 000000522751.jpg
I have custom python program downloaded from different source which modifies images, and takes input image path and output image path as argument:
python modifyImage.py path/to/input/image.jpg path/to/output/image.jpg
Problem statement:
I want to apply this program for each image in given subdirectories(apples,oranges etc.). There are a lot of folders and images with arbitrary names, so I can not do this by hand. Possible solution would be, firstly finding all *.jpg image paths and send these as argument to python script.
And I made script for updating *.jpg files only in current directory like this
for file in *.jpg
do
python modifyImage.py /"$file" /"$file"
done
But I need above script to work with subdirectories. Please help.