Get iTunes' / Finder Default Album Cover Image

Part of my application functionality is that it gets the current iTunes background image (using the Scripting Bridge). I am able to do it well. However, when the track does not play, I would like to get the default album art that both iTunes and Finder have. Is this possible from code? (or, if not, how else?)

Dark square with blue-gray music note

+4
source share
1 answer

Not sure where iTunes gets it, but I believe Finder gets it indirectly by asking for QuickLook for a thumbnail for the file.

So the correct answer is probably to do the same. Either instead of receiving album art manually, or as a backup, if that fails, get and show the QuickLook thumbnail.

However, if you need something quick and dirty, you can always read a resource called "Generic Artwork 512" like "png" from the QuickLook.framework package. For a little extra protection from Apple, moving in the future, you can make sure that QuickLook is loaded, and then look for the resource in any open bundle, but you still need to carefully monitor each new version of the OS.

You can also draw your very similar image - this is actually not a component of the interface, so you do not confuse the user by drawing non-standard components of the user interface, but it does not look ideal. And, of course, you can hope that the image is simple and universal so that you can legally copy it into your application, but only if you have good lawyers to reassure you that this is not such a stupid idea as it seems.

+3
source

Source: https://habr.com/ru/post/1416173/


All Articles