Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^3: Get MP3 Album Art with MP3::Tag

by true (Pilgrim)
on Jul 21, 2005 at 16:00 UTC ( [id://476896]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Get MP3 Album Art with MP3::Tag
in thread Get MP3 Album Art with MP3::Tag

You have to set binmode to STDOUT just like you did to the file. This example works off Windows running Apache2 and ActiveState perl 5.8
#!C:/Perl/bin/perl use MP3::Tag; my $mp3 = MP3::Tag->new("withimage.mp3") or die "no File"; $mp3->get_tags; $id3v2 = $mp3->{ID3v2}; my $Pic = $id3v2->get_frame("APIC"); # returns print "Content-type:image/jpeg\r\n\r\n"; binmode STDOUT; print STDOUT $Pic->{_Data};
jtrue

Replies are listed 'Best First'.
Re^4: Get MP3 Album Art with MP3::Tag
by allyc (Scribe) on Jul 21, 2005 at 23:44 UTC
    Thank you so much jtrue!

    The penny finaly drops.... should have realised that I needed to set binmode on STDOUT as well.... oh well we live and learn!

    Thank you so much for your help

    Al

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (None)
    As of 2024-04-25 00:51 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found