iTunes Art Redux

As you probably know by now, Apple has updated iTunes and the entire iPod lineup. I’ll spare you the “big picture” details available everywhere else on the web and focus on the single new feature that made my day.

Movies, iPod updates, and various album artwork views all pale in comparison to:

iTunes can automatically download album artwork when you add songs to your library. iTunes can also download album artwork for songs in your library that don’t already have artwork

Now I can stop wracking my brain trying to figure out just how their new artwork system works.

Apple’s new album artwork feature is even easier to use than my old workflow, where I would have to find the album in the iTunes Music Store iTunes Store, copy the URL, paste it into a web page, and drag the image to iTunes. Now I can simply right-click a song or group of songs, and choose “Get Album Artwork.” iTunes communicates with Apple* and loads the proper artwork with no further hassle. It’s a seamless and nearly effortless feature that I’m sure will get used often.

*iTunes notes that Apple does not collect any information about your music library. It seems Apple has learned to disclose everything since the MiniStore privacy concern.

Update: I figured out how the new artwork system works. Here’s a PHP script showing just how easy it is to find your own artwork for any artist/album.

Update: After the addition of some HTML to my original code, we now have a complete prototype for downloading album art. One thing yet to be explored is the full list of parameters that the “coverArtMatch” WebObjects script allows. So far, I’ve only seen Artist, Album, and Genre, but I’m quite sure there’s more to be discovered.

When you download this script and run it, you’ll be presented with Artist and Album fields, and a Get Artwork button. The form is submitted to the PHP script itself, the iTunes Store is searched for your album art, and the resultting image displayed. If there are no matches, you will receive a message to that effect. Enjoy!

Update: As quickly as the fun began, it seems that it will be ending. Apple has begun encrypting artwork on albums released later than October 3rd, and this prevents my script from properly displaying images. While older albums still work (for now…), this script will be rendered less useful as time goes on. With any luck, some clever hacker will figure out the encryption scheme sooner or later. I took a look at the givens, and the solution is quite simply over my head. Now we wait.

Advertisements
iTunes Art Redux

48 thoughts on “iTunes Art Redux

  1. it’s not perfect yet. It only found artwork for about half my library.

    Plus… notice the “album-flip-view” (for lack of a better description) flips WAY too fast? I also think they are placed too close together. Any thoughts?

    Other than that, Itunes 7 is a big improvement.

    Like

  2. I have a few issues with the new album art feature as well but in general it’s pretty nice:

    1) Art is not stored in the actual music file, or so it would seem. Instead it goes to an Album Art folder in your iTunes folder, and the folder and file structure are such that I cannot make much sense of them…
    I suppose this is good in that it prevents the bloat of adding the art to every file, but bad in that it makes the files less complete and portable in and of themselves.

    2) The few covers that I have been able to grab (the server was probably getting hammered when I tried yesterday evening) were not the old 600×600 covers, but something in between the 170×170 small size and the large size. I ran a strings search on the iTunes executable to see if I could find any reference to 600×600-100.jpg or the like but so far no luck.

    PS – Great blog and and excellent resource on various esoteric things I find myself interested in. I’ve been lurking for awhile (and leeching the RSS feed) but this is my first comment :-)

    Like

  3. It does appear that the artwork is stored separately. That sucks. At least it’s still retrieveable, though. I may do some packet sniffing and see just how it works — I’m curious, now.

    The .itc files that the artwork is saved in are just a JPEG wrapper. I opened one of the files in Hex Fiend, and noticed the “JFIF” header. Excited, I ran the .itc file through jpegextractor and it successfully extracted one JPEG image. Comparing the extracted JPEG to the .itc file from which it came, you can see there’s just a simple header followed by the raw, complete JPEG image. It’s a pretty straightforward process to extract the image, and it shouldn’t be long until it can be done programmatically.

    Like

  4. I’m thrilled this feature is back, though, I’ve noticed it is a bit picky. Sometimes track title, album name, artist and other details (even genre) caused it to miss a track featured in the iTS. Tweaking the album details — or trying other tracks — usually works.

    Like

  5. A bit more weird album art behaviour: It would appear that iTunes seems to insist on displaying downloaded art at 400×400 with the option to scale it up (badly) to 600×600. This is despite the fact that the downloaded art is pretty much all 600×600 to begin with… If somebody could verify this it would be cool.

    To test this out, right click and choose “Get Album Art” on a track that should probably have 600×600 art (pretty much anything new-ish on the store should work. I used Norah Jones – Feels Like Home as my test album). Once it downloads it should display in the album art window or in the coverflow view if that’s what you’re using. If you click on the art in the little album art window it will come up as a fairly sharp 400×400 image. Clicking the green maximize button makes it a fuzzy scaled-up 600×600.

    Now comes the weird part.

    If you “Get Info” on a track from your test album and go to the Artwork tab you can select your new artwork and copy it. Open up Preview and hit command-N (or “Make New from Clipboard”)… TaaDaa! 600×600 artwork. If you compare this image to the one iTunes gives you when the art window is maximized you can see how much better the preview image looks.

    My question is: What’s the point of this? A bug? Weird system glitch on my part? If Apple’s giving us the 600×600 art why doesn’t iTunes display it?

    I’m running an admittedly older G4 733 with a GF2MX, 1.5GB of RAM and a screen res of 1280×1024. Coverflow in iT7 works smooth, and all the 600×600 art I grabbed off the Store using the old scripts displays fine so I can’t see it being a system/screen-size limitation… Any ideas out there?

    PS – A bit more tech info/summary on what’s happening with album art just to add to this huge post :-p

    Downloaded art is indeed in JPG form, added into a .itc file, the header of which ends at offset 1EC. They are in ~/Music/iTunes/Album Artwork/Download/ and then further grouped into a folder structure I can’t understand. The artwork does not appear to be added to the music files themselves.

    The “Local” folder in ~/Music/iTunes/Album Artwork/ is only created when you enter “grouped with artwork” or coverflow mode using the toggle. It appears to be a cache of all the artwork already embedded in the music files, and it uses the same type of encoded folder structure as the “Download” folder. The files within are apparently exported by iTunes as PNGs with the same .itc wrapper and the same 1EC offset for the end of the header. This seems rather bloated since if you’ve embedded all your art within the music files themselves using the other two view modes will export it all over again…

    Like

  6. A bit of fun: I put my limited Applescript skills to the test and whipped up a droplet that will strip the first 492 bytes out of the .itc files, thereby making them back into JPEGs (or PNGS, although the type code and extension will be set to those of a JPEG)

    Please note that there is no error checking done by this script and it assumes that the files you are dropping on it are iTunes-downloaded ITCs as found in ~/Music/iTunes/Album Art/Download/. In turn, the script will create JPEGs on your desktop in the format “Cover1.jpg”, Cover2.jpg”, etc. If, for some reason, you already have files with these names on your desktop THEY WILL BE OVERWRITTEN WITHOUT WARNING. With that out of the way, here you go. Copy and paste into Script Editor, save as an application:

    ————-
    on open (ITCfiles)
    set n to 1
    repeat with theFile in ITCfiles
    set filRef to (open for access theFile)
    try
    set JPGFile to (read filRef from 493 to eof)
    close access filRef
    set newPath to (path to desktop as Unicode text) & “Cover” & n & “.jpg”
    set newRef to (open for access file newPath with write permission)
    set eof newRef to 0
    write JPGFile to newRef
    close access newRef
    tell application “Finder”
    set nullCh to ASCII character 0
    set nullFourCharCode to nullCh & nullCh & nullCh & nullCh
    set file type of file newPath to “JPEG”
    set creator type of file newPath to nullFourCharCode
    end tell
    end try
    set n to n + 1
    end repeat
    end open
    ————-

    Hopefully this can help anybody who finds all their album art stuck in a “proprietary” format :-)

    Like

  7. Whoops, just copying and pasting from here makes Script Editor give compile errors about “unknown tokens” due to the curly quotes. You’ll have to do a find and replace to make the curlies into straights or else do it manually. Sorry :-(

    Like

  8. Santiago says:

    The PHP works just fine… But there’s some way to do this with a Form or something like that? Insted of modify the PHP file and reload it each time? Or am I missing something? Thanks!

    Like

  9. I just found this site through my referrer logs from the previous iTunes art post. Thanks for the link!
    Just last night, I was messing around with the ITC files and wrote a script to convert them to JPG/PNG, but it looks like you guys are way ahead of me there! Good to know someone else is messing around with this stuff.

    I did find an odd phenomenon when I was poking around that you may not know about yet. Apparently, the artwork that you download for free isn’t necessarily the same artwork as you get with a purchased track.
    http://marv.kordix.com/archives/000915.html
    Very odd.

    Like

  10. Bob in Winter Park FL says:

    I don’t really care about album artwork … how do I turn off this annoying dialogue box that pops up everytime I start ITunes? Do I have to hit “cancel” on this from now until eternity until Itunes takes the hint?

    Like

  11. Ata says:

    I have most of my album cover art in the album folder of my music labeled as ‘folder.jpg’ Is there a way to get Cover Flow to look in the album folder and display those Jpegs?

    Like

  12. John Lockwood says:

    Anyone know how to get in touch with Matt (as per message 11 above)?

    I would like to get a copy of his modified version to in turn modify it further to allow selecting which iTunes store it searches. This would then give you a better chance of finding artwork which corresponds to different country editions.

    By the way, I believe I have found another example of an encrypted album art :-( see message 20 above.

    Try searching for Artist – Fatboy Slim and Album – Why Try Harder

    The US iTunes store does return a result and supposedly a picture but it is not a standard jpeg or png and cannot be viewed. The UK iTunes store does return a viewable picture of the UK edition of this Album! (Hurray!)

    Like

  13. HELP!
    This is a total dilettante in dire need of you professional’s advice. I asked iTunes to automatically download whatever artwork it can. Then I plugged my iPod and I notice that there is no way to download all the artwork to my iPod. I DID check the “display album artwork on your ipod” box and I keep on synchronising iTunes and iPod and nothing happens… except for those artworks that I pasted manually…
    THANKS FOR LETTING ME KNOW WHAT TO DO

    Like

  14. Hi,

    I have a couple of questions, and hope that some of you guys can shed some light on my doubts and let me better understand this artwork matter.

    Why do you all want so badly to get the artworks out of the .itc files?
    Seriously, it looks like that is the main thing everybody want to do right away…I might be missing something that I could do with the .jpg or .png files, and the new .itc do not allow me to do.
    I’m a bit confused, shouldn’t the opposite be better?
    My point is: the smaller the song-files are the more of them I can fit into my old G3 iPod. For this reason being able to keep the artworks out of the song-files sound interesting. Is that what happens storing the artworks in the Album Artworks folder? Will them be downloaded into the iPod or not?

    If this is the case I’d love to take the ‘already embedded in the song-files’ artworks (old iTunes versions) out of the files and put them into the new .itc files, but I can’t see any comment about this anywhere.

    Also, does the ‘iTunes Artwork’ flipping-images Screensaver pick the images from the Album Artwork folder too, or it only shows the ones embedded in the song-files?

    Like

  15. Basically, we want data out of the .itc files and into the actual ID3 tags of the MP3, making each a self-contained “music unit,” if you will :-) Making songs portable with all data contained is more important to me than file size — my songs are already 192 Kbps+, save for those purchased from iTunes.

    While I haven’t tried, I’m sure the external album covers are loaded onto the iPod, as displaying album art has been one of the cool features since the iPod Photo.

    iTunes’ “coverflow” view does indeed pull images from both sources — external and embedded. Like most other Mac things, it works how you’d expect it would.

    Like

  16. I see Collin, but I still prefer to keep the files as small as possible.

    My problem started when I switched from my Win laptop to MBP, and I moved over the whole iTunes folder.
    Then I found that I had hundreds of AlbumArt_{*}.jpg files scattered around my music folders. I wondered where those files were coming from, and how to get rid of them. I’ve been told that those are the artworks that Windows Media Player downloads automatically, so I had them originally on the PC and I didn’t know.

    Since they’re so many I thought that I could have the iTunes Artwork screensaver showing those pics (I asked about the screensaver, and you answer about coverflow, so I assume that iTunes’ “coverflow” and “iTunes Artwork” screensaver both show the same images and work in the same way).
    My question is: can I put those files into the .itc files, in a way or another, or do I need to put them in the ID3 tag, one by one, which as I said I wouldn’t like?

    When I bring up the Artwork window for a file within iTunes, how can I tell if the shown artwork is embedded or external?

    My iTunes is NOT set to “Automatically download missing album artwork”. How come then that I have a number of .itc files considerably higher then yestereday?
    When I choose “Get Album Artwork” from the Advanced menu, does iTunes automatically download ALL the missing artworks or just the one for the selected song?

    Thank for taking the time to answer my silly questions…

    Like

  17. Parr says:

    I want to do just the opposite, import my album artwork into the iTunes artwork database. This enables;
    Coverflow to work smoother/faster by loading artwork once per album instead of per song. This may also be more important when iTV (Airport Express video) arrives.

    Also using the itunes .itc database, The artwork is not loaded into each song, resulting in significantly smaller music files.

    Does anyone know how to generate the appropriate .itc files and incorporate them into the existing itunes artwork file structure?
    Thanks

    Like

  18. I’m assuming you can prepend the .itc header to existing JPG files, and link to them from the iTunes Library XML file. iTunes manages this on its own, so you should be cautious while messing with it if you fear “reloading” iTunes’ music.

    Like

  19. See the last comment here.

    Archived right here, just in case. — Collin

    These are Persistent IDs, which you can find in iTunes Music Library.xml and folder structure is like this:

    Library Persistent ID -> decimal value of last hex digit in tracks persistent ID -> dec value of before last hex digit -> dec value of 3rd hex digit from the end -> Library persistent ID – Track persistent ID .itc

    F3AF81BA9C7F669C -> 05 -> 03 -> 10 -> F3AF81BA9C7F669C-5C5970C9B6116A35.itc

    Essentially, it breaks down like this (at least, on my Mac):

    ~/Music/iTunes/Album Artwork/ possesses two subfolders, Download and Local. Inside each of these will be one folder for each iTunes Library you have (most people probably just have one) with the Library Persistent ID as the folder name (you can confirm this by looking at the file ~/Music/iTunes/iTunes Music Library.xml).

    Then you’ll have to traverse three levels of folders to get to the .itc file; they are labeled according to the decimal representation of the last three hexadecimal digits prior to the .itc filename extension in reverse order (i.e. for an .itc file that ends with A01.itc it would be in /01/00/10/). The filename of the .itc file has the structure “Library Persistent ID”-“Track Persistent ID” but this only seems to be true for files in the Local subfolder. I have not yet been able to decipher where the second half of the filename comes from for the files in the Download subfolder.

    The .itc header is not identical from file to file; it also encodes both the Library Persistent ID and the second part of the filename (Track Persistent ID in some but not all cases) as well as a block stating “down” or “locl” and some other information I haven’t figured out yet. The data portion also does not have to be a JPEG/JFIF stream; I have seen a few PNGs so I would assume that most of the major graphical file types can be supported.

    Like

  20. deciphering the iTunes .itc file format…

    iTunes 7 incorporated a technology called CoverFlow which allows you to browse through your albums by flipping through images of the album covers. It has the ability to download the album images from the internet, but frankly, it’s not very……

    Like

  21. Thanks. I figured out a few more bits of the specification; I’ve started a write-up here. The bits that are probably most relevant for people here (who want to strip the header and write out the correct jpg or png) are bytes 1-4 and 293-296. These encode unsigned 32-bit integers; when you total them together that is the total length of the .itc header.

    Like

  22. Aliyah says:

    I’m almost afraid to download the new version because I really don’t want to have coverflow. I have it on a laptop, and it is really annoying. Is there any way to turn it off?

    Like

  23. Ken says:

    Is there a way to create .itc files from JPGs? In other words, do the reverse of what everyone seems to be trying to do? I want to be able to use the “iTunes Art Screen Saver” in Tiger but I want it to use images OTHER than album art. The screen saver seems to only use the .itc files for its source. I have resized the images (of film stars from the 30s, if you wanna know) to 500×500, and I figure if I can somehow turn them into .itc files and drop them into the “Album Artwork” folder in my “iTunes Music” folder I’ll fool the screen saver into using these.

    Anyone with a method to do this? I like the screen saver and it’s “Laugh-In” like open/close windows function–I’d just like to use art other than album covers.

    Like

  24. rapuak says:

    Hi guys, months has passed since Denis last update. Is anything changed since then? I still have not found a way to move embedded artworks from the mp3/AAC files to the iTunes Album Artworks folder.

    Denis, did you manage to move further?

    Like

  25. Aki says:

    hmm, as the new version of itunes can download the album art for you music, but requires a sign-up/login and well some countries do not have an ITMS.So I am from a country where the ITMS store does not exist, how the heck am gonna register or login? …that sucks!

    Like

  26. mr. t says:

    i only have the download folder. when does itunes store artwork in Local folder?

    i also want to know how to get track info from itc in download folder.

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s