Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Displaying dynamic image in place of stub image (Read 2085 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Displaying dynamic image in place of stub image

I'm trying to set up my library so that if an artist image isn't available, the letter of the artist (saved as an image) is displayed instead. However, I don't want to have to put an image of the letter A into 29 artist folders, B into 53 artist folders, and so on.

In the same way that "%filename%.jpg" and "%album%.jpg" are two of the default patterns under "Front cover", I've tried to do something similar under artist using a title formatting string, but also including a full file path as part of it:
Code: [Select]
C:\Program Files (x86)\foobar2000\letters\$left(%album artist%,1).png

The idea is that it pulls back "B" for "Beatles", "S" for "Stevie Wonder", etc., but this doesn't seem to work, and the stub image is still displayed. Is there something I'm missing, or is this a limit of foobar2000 and I need to find an alternative way of achieving this?

Re: Displaying dynamic image in place of stub image

Reply #1
Should work in the standard version with the stub image path, at the bottom of the preferences > Display setting.

Re: Displaying dynamic image in place of stub image

Reply #2
Should work in the standard version with the stub image path, at the bottom of the preferences > Display setting.
I’ve tried this and it doesn’t seem to work, with the Album Art Viewer panel just showing "[no image]" and Facets not showing anything at all.

It seems that foobar2000 sees that as a literal string, as when you go to choose a replacement stub image, the File Explorer "File name" field shows "$left(%album artist%,1)", believing it to be an actual file.

Re: Displaying dynamic image in place of stub image

Reply #3
Just something to try but does putting it in quotes make a difference?

Code: [Select]
C:\Program Files (x86)\foobar2000\letters\"$left(%album artist%,1)".png


Re: Displaying dynamic image in place of stub image

Reply #5
You can't use title formatting in stub image path. But you can use it in the search pattern and when placed at the bottom, it serves the same purpose. Note that parenthesis are special characters and require escaping. Use 'C:\Program Files (x86)\foobar2000\letters'\$left(%album artist%,1).png as your last pattern.

Re: Displaying dynamic image in place of stub image

Reply #6
You can't use title formatting in stub image path. But you can use it in the search pattern and when placed at the bottom, it serves the same purpose. Note that parenthesis are special characters and require escaping. Use 'C:\Program Files (x86)\foobar2000\letters'\$left(%album artist%,1).png as your last pattern.
It works! Thank you so much!

I don’t know why I missed the issue with the parentheses, as I’ve come across other instances where I’ve had to escape other characters to get a string to work. I’d almost given up and had started copying images of letters, each one called “artist.png” into the artist folders, using the “..\artist.*” string I was already using for actual artist images to display them.