Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Adding "album art" to MP3s ...

by andyford (Curate)
on Oct 24, 2007 at 13:05 UTC ( #646886=note: print w/ replies, xml ) Need Help??


in reply to Adding "album art" to MP3s ...

#!/usr/bin/perl use warnings; use strict; use MP3::Tag; my $artfile = 'barred-spiral-NGC1512.jpg'; my $art; { local $/=undef; open my $jpg,'<', $artfile or die "Couldn't open file: $!"; binmode $jpg; $art = <$jpg>; close $jpg; } my $mp3 = MP3::Tag->new('Andrew_Ford__Cygnus_X1_Trawler.mp3'); $mp3->get_tags(); $mp3->{ID3v2}->change_frame("APIC", chr(0x0), 'image/jpeg', chr(0x0), +'Cover Art', $art); $mp3->update_tags(); $mp3->close();

non-Perl: Andy Ford


Comment on Re: Adding "album art" to MP3s ...
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://646886]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (9)
As of 2015-07-30 07:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (270 votes), past polls