Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Adding cover art to iTunes4 the easy way' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Adding cover art to iTunes4 the easy way
Authored by: bluehz on Apr 29, '03 01:13:37PM
OK - this is not exactly how to add covers - but its a perl snippet I just picked up that I thought some people might find useful. It will extract cover art from MP3 file. It reauires the MP3::Info perl module. I have been having trouble with CPAN.org for the last week - so I manually installed the perl module. Here is a script to download and install the required perl module:
#!/bin/sh
#
# Installs the MP3::Info perl module
#
# Use: perl -MMP3::Info -e '$x = get_mp3tag(shift, 2, 2); $i = 
$x->{PIC}; $i =~ #      s/^(....).//; ($e = $1) =~ s/\W//g; 
open $f, "> image.$e"; print $f $i'
#      file.mp3
#
# save this script to desktop then chmod 755
#

echo "Installing MP3-Info-1.02 perl module..."
cd ~/Downloads
wget http://unc.dl.sourceforge.net/sourceforge/pudge/MP3-Info-
1.02.tar.gz
tar -zxvf MP3-Info-1.02.tar.gz
cd MP3-Info-1.02
perl Makefile.pl
make
make test
echo -e "Everything checks out - do you want to complete the 
install? [y|n]: \c" 
read ans
if [ $ans = yes ] || [ $ans = y ]; then
sudo make install
echo "MP3-Info-1.02 perl module successfully installed!"
else
echo "Bye"
exit
fi
After installing the perl module you can use a cmd like this to extract the album cover art to a file named image.xxx [xxx is format I assume] in the same directory as the mp3.[p]
perl -MMP3::Info -e '$x = get_mp3tag(shift, 2, 2); $i = 
$x->{PIC}; $i =~ s/^(....).//; ($e = $1) =~ s/\W//g; open $f, 
"> image.$e"; print $f $i' file.mp3
Note I can not take credit for this snippet - I picked it up over on the Clutter site forums so if you use it - you might want to stop by and thank him for it. Sorry about the wrapping above - I don't know whats going on with the forums these days.

[ Reply to This | # ]