diff -wu flac2mp3-0.3.0rc1-orig/flac2mp3.pl flac2mp3-0.3.0rc1/flac2mp3.pl
--- flac2mp3-0.3.0rc1-orig/flac2mp3.pl	2007-07-22 04:20:58.000000000 -0700
+++ flac2mp3-0.3.0rc1/flac2mp3.pl	2008-07-21 12:29:45.000000000 -0700
@@ -17,6 +17,7 @@
 use Audio::FLAC::Header;
 use Carp;
 use Data::Dumper;
+$Data::Dumper::Useqq = 1;
 use File::Basename;
 use File::Find::Rule;
 use File::Path;
@@ -44,9 +45,10 @@
 our $lamecmd = 'lame';
 
 # Modify lame options if required
+#  --noreplaygain
 our @lameargs = qw (
-  --noreplaygain
   --preset standard
+  -Y
   --quiet
 );
 
@@ -61,7 +63,7 @@
 # hash mapping FLAC tag names to MP3 frames
 our %MP3frames = (
     'ALBUM' => 'TALB',
-
+    '_ALBUM_COVER_ART' => 'APIC',
     #    'ALBUMARTIST'             => 'TPE2',
     'ARTIST'                  => 'TPE1',
     'BAND'                    => 'TPE2',
@@ -365,6 +367,8 @@
 
             # loop over all valid destfile frames
             foreach my $frame ( keys %MP3frames ) {
+		# skip private frames (prefaced with an underscore)
+		next if ( $frame =~ /^_/ ); 
 
                 $::Options{debug} && msg("frame is '$frame'");
 
@@ -444,6 +448,49 @@
 
                 }
             }
+	    # see if the cover art needs updating - art on the FLAC
+	    # side isn't treated as a comment, hence the special
+	    # treatment here
+	    my $src_image_data = '';
+	    my $dest_image_data = '';
+	    # try to grab the cover pic from the FLAC
+ 	    # if we found one, compare them
+ 	    my $src_picture_block = $srcfile->picture();
+ 	    if ( defined $src_picture_block ) {
+ 		$src_image_data = $src_picture_block->{'imageData'};
+		$::Options{debug} && msg( Dumper \$src_picture_block );
+	    }
+
+	    # grab the APIC data from the mp3
+	    my ( $tinfo, $name ) = \
+	        $ID3v2->get_frame( 'APIC', 'intact' );
+	    if ( defined($tinfo) and ref( $$tinfo ) eq 'HASH' ) {
+		$::Options{debug} && msg( Dumper \$tinfo );
+		$dest_image_data = $$tinfo->{"_Data"};
+	    }
+
+	    $::Options{debug} && msg( "checking album art\n" );
+	    #
+	    # these are crazy verbose, uncomment them if needed
+	    #
+	    #$::Options{debug} && msg( "src data:" ) && msg( Dumper \$src_picture_block );
+	    #$::Options{debug} && msg( "tinfo:") && msg( Dumper \$$tinfo );
+	    #$::Options{debug} && msg( Dumper \$src_image_data );
+	    #$::Options{debug} && msg( Dumper \$dest_image_data );
+	    if ( $src_image_data ne $dest_image_data ) 
+	    {
+		$::Options{debug} && msg( "album art differs\n" );
+		$pflags{tags} = 1;
+		if ( length( $src_image_data ) > 0 ) {
+		    # whack it into the frames_to_update hash
+		    my $img_info;
+		    $img_info->{'data'} = $src_image_data;
+		    $img_info->{'mime'} = $src_picture_block->{'mimeType'};
+		    $img_info->{'desc'} = $src_picture_block->{'description'};
+		    $frames_to_update{'_ALBUM_COVER_ART'} = $img_info
+		}
+	    }
+
         }
         else {
 
@@ -590,9 +637,22 @@
                     $::Options{debug}
                       && msg("Setting $frame = '$framestring'");
 
-                    # COMM, TXX, and UFID are Complex frames that must be
+                    # APIC, COMM, TXX, and UFID are Complex frames that must be
                     # treated differently.
-                    if ( $method eq "COMM" ) {
+		    if ( $method eq "APIC" ) {
+			my $img_info = $frames_to_update{'_ALBUM_COVER_ART'};
+			my $img_size = length($img_info->{'data'});
+			$::Options{debug} 
+			  && msg(" adding APIC frame w/ mime type $img_info->{'mime'}', desc $img_info->{'desc'}, size $img_size" );
+			$mp3->{"ID3v2"}
+			  ->add_frame( "APIC", 
+				       $img_info->{'mime'},
+				       3, # "Cover (front)"
+				       $img_info->{'desc'},
+				       $img_info->{'data'}
+			      ); 
+		    }
+                    elsif ( $method eq "COMM" ) {
                         $mp3->{"ID3v2"}
                           ->add_frame( $method, 'ENG', 'Short Text',
                             $framestring );
Common subdirectories: flac2mp3-0.3.0rc1-orig/lib and flac2mp3-0.3.0rc1/lib

