Hello all! First post and all that.
I'm hoping some kind-soul can help me out with a bash script.
I'm trying to figure out how to get a script to:
- scan folders and sub folders of specified directory for any file with the extension .jpg or .png
- minimum folder depth of 3
- if only 1 image, rename to Folder.<original extension>
- if 0 or more than 1, output folder path to /<user name>/documents/follow-up.txt
- if 1 image found & dimensions below 400x400 output to above txt file
- if 1 image found & has non-square dimensions, output to above txt file
I've googled as best i can, found tutorials, but i admit; It's all very confusing for me. I don't handle lines of text all too well. Much more of an image person. Down-side to being a graphic designer, i suppose
What it's for:
I'm trying to finally finish cleaning up my music collection, and the album art (or lack thereof) is my final hurdle.
The minimum folder depth is to make it so that only album folders are scanned. My collection is organised as so: /Music/<basic genre>/<artist>/<album>, and i would be launching the script from /music.
Parts of what i can find and understand tell me that i can find the image types with:
find / -name ‘.jpg’ -o -name ‘.png’
And i can compare a list of folders with and without the search results with:
find ./* -mindepth 3 -type d > albums
diff albums has_art > needs_art
I realise half of the snippets of code i've found are probably laughably wrong, but hey. I'm trying
Any and all help appreciated.