I have been playing with Quick action > Export cover to file, but it seems that is too limited for my needs, so I think I might be able to use scripting functions - but I have never done this before sorry and can't figure out "how" especially since most of the script functions and examples seem to involve writing tags, not cover art files!
Music is in a fairly typical directory structure:
Tracks are all individual (no tricky iso or cue files here) but are a mixture of mp3 and flac files. Compilations use %albumartist% = "Various Artists", yes.
For the MOST part, my tags are correct and most albums HAVE embedded cover art (type = front cover).
If any albums are missing covers - that's because the album is rare enough that I couldn't find art online anywhere, manually, and didn't have a scanner available to scan the jacket...
cover.jpg file to be saved into each album folder.
However, I want to use the following logic / decisions about what to save and what to overwrite!
Test1. IF cover.jpg does not exist, then write output file cover.jpg from saved front cover embedded in the files (assume they're all the same ie just open track#1).
That scenario is actually met by the existing Quick action yes, but not the rest!
1a However, resize output cover.jpg file as max 700x700 if the embedded front cover was say 2000x2000 and/or convert format if embedded art was png/bmp.
Test2. IF cover.jpg DOES exist, then check the widthxheight size of the existing file.
CASE1 IF existing cover.jpg is bigger than 700x700, then look at embedded album art of type = front cover, AND IF such album art exists, then fetch size AND IF it is larger than 700x700 then output cover.jpg, resized to max 700x700 and/or change format from png/bmp > jpg.
OR If embedded art is less than or equal to 700x700, no need to downsize, only format from png/bmp > jpg.
This output file SHOULD OVERWRITE the existing cover.jpg file.
If existing cover.jpg is less than or equal to 700x700 - no action required, continue parsing folders (ie don't bother with test3).
Test3. IF cover.jpg does not exist AND tracks do NOT have embedded album art type = front cover, then CHECK if file = folder.jpg exists.
CASE 1 If folder.jpg does exist then do similar size & format logic checking (as above) and output downsized cover.jpg to max 700x700 and type=jpg from png/bmp.
CASE 2 If folder.jpg does NOT exist, then skip this folder and parse the next.
Why do I want to do this?
After a huge amount of trial and error, I have found that my car stereo headunit which plays both mp3 and flac files from USB, for album cover art uses ONLY file = cover.jpg and ONLY if less than or equal to 700x700 size. It doesn't actually look at embedded album art, nor folder.jpg. So while things like WMP, kodi & Plex all happily read the embedded art and display it fine, the car headunit only shows a few!
If what I'm trying to do can only be done manually, then - yeah I can't see me bothering with that just for the car stereo, but if it can be scripted that would be awesome!