Re: ID3 writeback fails (Invalid Language in COMM)

Matt McClure <[email protected]>
Newsgroups gmane.comp.audio.netjuke.user
Organization me
Message-ID <[email protected]>
Matt McClure wrote:
> One more bug to report though... after editing track info, the "Refresh"
> button only reads the first 30 characters of the track name tag.
> Looking at the MP3 itself, I can see the whole string is present in the
> tag (40 characters).

Seems that getid3 isn't overriding the id3v1 tags with the id3v2 tags as
it claims to do in the changelog:

>      Comments are now available in the root 2-dimensional array
>      ['comments'] - each entry in this array will contain one or more
>      strings. For example, if there are two artists then
>      ['comments']['artist'][0] will contain the first one and
>      ['comments']['artist'][1] the other. All keys are forced
>      lowercase. Comments will be stored in the ['comments'] array in
>      this order of precedence:
>      1) Native format tags (ASF, VQF, NSV, RIFF, Quicktime, Vorbis)
>      2) APE tags
>      3) ID3v2
>      4) Lyrics3
>      5) ID3v1
>      Lower-priority tags will not overwrite or append existing values
>      of higher-priority tags (for example, 'artist' in ID3v1 will be
>      ignored if already specified in APE), but missing values will be
>      filled in (for example, if 'album' is specified in ID3v2 but not
>      in APE, it will be included in the ['comments'] array).

I applied the attached patch, and it works for me.  However, I'm only
using MP3 with ID3v2 and ID3v1 tags, so YMMV if you're using other file
types.

-- 
Matt
http://www.faradic.net/~mmcclure/

    The whole genre of the one-bedroom apartment on the Lower East
    Side has escaped the [MTV] Cribs radar.
        -Mike Doughty
override_id3v1_tags.patch (text/plain, 984 B)
--- getid3.php.dist	2003-03-07 11:55:39.000000000 -0500
+++ getid3.php	2003-03-17 02:31:57.000000000 -0500
@@ -602,7 +602,15 @@
 		$ThisFileInfo['tags'][] = 'id3v2';
 
 		if (isset($ThisFileInfo['id3v2']['comments'])) {
-			CopyFormatCommentsToRootComments($ThisFileInfo['id3v2']['comments'], $ThisFileInfo, true, false, false);
+			//CopyFormatCommentsToRootComments($ThisFileInfo['id3v2']['comments'], $ThisFileInfo, true, false, false);
+
+			// Change 2nd and 3rd args to true so this will overrride
+			// id3v1 tags.  Necessary because of calling order in
+			// GetAllFileInfo().  No idea if this is correct.  It
+			// seems to me that you'd always want to call this with
+			// true, true as the last 2 args. -- mlm 2003-03-17
+
+			CopyFormatCommentsToRootComments($ThisFileInfo['id3v2']['comments'], $ThisFileInfo, true, true, true);
 		}
 
 	}
@@ -717,4 +725,4 @@
 	return str_replace('<!--GETID3VER-->', GETID3VERSION, $string);
 }
 
-?>
\ No newline at end of file
+?>
signature.asc (application/pgp-signature, 252 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQE+dX5GrGgMpZIoLA8RAoYZAKCc7FHnImrguzJmeIjurksq8Go6/wCg7mPk
8lvUqXCLaboT+M3G0x2A7Fc=
=Q6gI
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.