Home : Digital Media : About

Digital Media » iTunes Notes & Observations

Some personal notes [1] relating to iTunes, primarily from a programming point of view and not in any particular logical order. Please note that this is primarily for my own reference and is a work in progress.

iTunes Version: 7.6.0.29.

Cover Art/Artwork

The first image, i.e. the one on display in Cover Flow, is stored on disk (but also retained in the tags) when Cover Flow is turn on (for performance reasons) in ITC format and in the tags when not.

Artwork that accompanies purchased tracks is in PNG format and, at the time of writing (June 5, 2008, U.K.), is around 400px by 400px (in the ITC files). Artwork for non-purchased tracks obtain via iTunes is in JPG format and is around 600px by 600px [2]. Although larger images are provided in JPG format they are of lower quality. It is not unreasonable to deduce that all files are derived from one image (see Artwork Export below).

iTunes has no support for artwork type, e.g. cover, media label, etc.

Adding/Import/Export

Adding/Import

iTunes should be able to handle images in any format that is supported by QuickTime.

Adding artwork to media items can be achieved in a number of ways ;

  1. Using the iTunes interface ;
    1. The iTunes Music Store provides one image per album via the “Get Album Artwork” option. Note that images will only be returned for exact matches of the album title.
    2. Via the “Get Info” option and selecting the “Artwork” tab. You can either open a file or paste a copied image into the dialogue box.
  2. Via Scripting.

Export

Exporting artwork as separate files is achieved via scripting and should return either a PNG or JPG file [3]. Unless the artwork is for a purchased media item, the input format is the decider on the output format. Basically, any non-lossy input format should result in a non-lossy output file (PNG). Purchased tracks would seem to be the exception as a resized JPG image is returned.

Exporting Multiple Images

If you wish to retain the highest quality for the purchased media items then the iTunes provided image needs to be the first one. As you cannot? determine the iTunes provided items then an (extreme) method would be to back up your entire library and files then convert the ITC files before iterating through the artwork items and deleting the first image until there is only one left. Restoring the backed up files would then return the state of things.

Converting ITC Format Files

There are a number of articles available regarding the ITC format, some of which run to a detailed examination, but for my own use a simple means to convert them to a standard format is enough.

The files are stored in an unusual directory structure based upon the Persistent ID of the media item(s) they relate to. If the media item is a purchased one then the location is easy to calculate, but if not the identifier would seem to be related to an existing Persistent ID of a file that isn’t necessarily in the local library.

If you are not concerned about absolute quality then it isn’t an issue as the files can be obtained via scripting. It must be noted that you may need to consider the deletion of any files you manually add — at some point you may want higher quality ones than can be obtained from your iTunes library.

ITC Format

Is either a PNG or JPG file with an additional header ;

  1. To make it harder for you to use elsewhere. ;)
  2. Although both PNG and JPG have metadata storage features I do suppose it is to provide metadata to iTunes.

Update: iTunes 8 changed the format of the ITC files to store multiple PNG/JPG files, presumably for the view by album feature.

Lyrics

Are stored in the tags of the media files and so access to the database is not required.

The Library

The library consists of a proprietary database (iTunes Library.itl). Also created and, continually updated as iTunes is running, is a separate XML file (iTunes Music Library.xml). The XML file is in reality and an Apple Property List (similar to Windows INI files) and is more formulated for readability than parsability. It is therefore not easily processed via the usual means and so, due to the size of some of the files, some manipulation may be preferable before treating it as an XML file. More…

Exported playlists share the same format.

Notes

[1] All notes are based upon the Microsoft Windows version of iTunes.

[2] There may be regional variations in the files provided. I have seen varying reports of the image sizes and whilst I have no reason to suspect they aren’t true, copyright concerns over providing printable artwork and, more especially, the abuse of the iTunes services by non-customers would seem to be a good reason for the limited sizes provided at present.

[3] Tested with PSD, PNG, BMP and JPG, but only by exporting the images using iTunes and not extracting the images from the media files.

Home : Top

Last Updated: May 26, 2009 3:49 PM :: © 2009 by Darren Burnhill