App to Extract Embedded Cover Art

GO TO ADMIN PANEL > ADD-ONS AND INSTALL VERTIFORO SIDEBAR TO SEE FORUMS AND SIDEBAR

cucuzza

New member
Joined
May 17, 2010
Messages
39
Points
0
Is there an app that would batch extract the cover art embedded into mp3s in iTunes and save them as .jpg or .png to your desktop) that anyone can suggest here?

Features that I'd love:
1. Ability to extract on a file by file basis

2. Ability to extract UNIQUELY by album (there could be 11 files in an album, but it would extract only one file assuming the same picture is being used for all 11 files. It'd be great if it'll give me two unique files if (in another example) there are 11 files and 10 of the 11 use the same file and 1 of the 11, for some reason, is using another file).

3. It could tell me the dimensions of the album art and the file type.

Thanks!
 

cjmnews

Moderator
Staff member
Moderator
Joined
Apr 26, 2006
Messages
9,424
Points
38
Location
Arizona
Not that I know of, the scripts I have are very basic.

This is one for PC like Doug's but all it does is get the art from the selected tracks in your library.
And outputs them by song name and track number to C:\Windows\Temp

Save the text in the code block as GetArtwork.js
Open a command prompt where you saved the file.
Open iTunes
Select the tracks
In the command prompt type: wscript /nologo GetArtwork.js and press return.

You can use normal tools to see the size etc. The track number was there for songs with nearly duplicate names due to truncation.

You can change the output location to a different directory. This was one we should all have around.

Code:
var iTunesApp = WScript.CreateObject("iTunes.Application");
var mainLibrary = iTunesApp.LibraryPlaylist;
var tracks = iTunesApp.SelectedTracks;  //Remove leading slashes to only work on selected tracks, and comment out the next line.
//var tracks = mainLibrary.Tracks;  //Remove leading slashes to get all art from a library, and comment out the previous line.
var numTracks = tracks.Count;
var i;
var j;

for (i = 1; i <= numTracks; i++)
{
	var currTrack = tracks.Item(i);
	var artwork = currTrack.Artwork;

	for (j=1; j <=artwork.Count; j++) {
		var formatString ="";
		var currentArt = artwork.Item(j);
		var format = currentArt.Format;

		if (format == 1)
			formatString = ".jpg";
		else if (format == 2)
			formatString = ".png";
		else if (format == 0)
			formatString = ".bmp";

		if (formatString.length > 0) {
			var name = currTrack.Name.replace(/[#:?\\\/,\.\"\' ]+/g , "")+ currTrack.DiscNumber + "art_" + j;
			currentArt.SaveArtworkToFile("C:\\Windows\\Temp\\" + name + formatString);
		}
	}
}

WScript.Echo("Done");
 
Top