Audacity Bug Summary
••• Introduction •••
••• Keywords •••
    Audacity 3.0.3 development began 19th April 2021

Audacity Bugzilla



Bug 188 - Imported ID3V2 tags stripped when exported without metadata editor appearing
Imported ID3V2 tags stripped when exported without metadata editor appearing
Status: RESOLVED FIXED
Product: Audacity
Classification: Unclassified
Component: Formats
1.3.12
PC Windows (all)
: P3 Repeatable
Assigned To: Default Assignee for New Bugs
: patch
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-07-29 05:11 UTC by Gale Andrews
Modified: 2018-08-20 11:45 UTC (History)
3 users (show)

See Also:
Steps To Reproduce:
1 In Foobar or Windows Media Player, add tags to an MP3 for all seven Audacity default tags plus others such as "Band" or "Composer" 2 Start new Audacity session 3 Set up a chain to normalize and export MP3 3 File > Apply Chain, Choose the chain you set up, Apply to Files 4 Select the MP3 you tagged and Open to run the chain 5 File > Close to clear Metadata Editor 6 Re-import the MP3 from the "Cleaned" folder inside the directory you imported from The MP3 will have lost the Year tag and all the non-default Audacity tags. These are retained if the MP3 tagged in the other application is exported as MP3 via File > Export. The same problem exists if you import the MP3 into a clean project and apply the Normalize/Export MP3 chain to the project. The problem does not occur if Audacity created the tags in the MP3 file. Not tested on other OS'es or with other formats.
Release Note:
* (Windows) When importing an MP3 for export via a chain, "Year" and custom ID3 tags are removed if the original tags were not written by Audacity
First Git SHA:
Group: ---
Workaround:
Closed: 2018-08-20 00:00:00


Attachments
Fixes id3v2 tag recognition problem on import (1.61 KB, patch)
2011-02-26 19:35 UTC, Leland Lucius
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gale Andrews 2010-07-29 05:11:02 UTC

    
Comment 1 Leland Lucius 2011-02-26 19:35:40 UTC
Created attachment 95 [details]
Fixes id3v2 tag recognition problem on import

This should fix the "corruption" issues.  What was really happening was that the import was assuming that if the file had ID3V1 tags, then it didn't have id3v2 tags and it didn't turn on the v2 indication in the tag class and Audacity would simply ignore any v2 tags.

Unfortunately, libid3tag doesn't expose any way of determining whether the file really does have v2 tags or not, so, rather than modifying existing routines, I added another that simply returns the highest version tag set found in the file.

Leland
Comment 2 Leland Lucius 2011-02-28 11:36:00 UTC
I've looked into this a bit more.  The import, which improperly identifies the version of tags, is definitely the issue here, but I'm wondering if my solution is overkill.  It will certainly fix the issue, but there might be an easier solution.

The Tag class maintains a flag that determines whether the tag format is ID3V2 or not.  This flag defaults to TRUE and whenever the tags are cleared, it gets reset to TRUE.

The reason there is a difference with tag handling during chain processing and when importing/exporting manually, is because the tag editor isn't displayed.  You can prove this by going into preferences and disabling the Metadata Editor which will cause imported ID3V2 tags to be stripped when exported.

There's actually a "bug" in the TagsEditor::TransferDataFromWindow() that doesn't maintain the V2 flag properly.  It clears the tags and then repopulates them from the data in the dialog, but that clear also resets the V2 flag to TRUE, even if it was FALSE.  So, that will need to be corrected as well.

However, why bother worrying about whether the input file had only V1 tags or not?  Sure, go ahead and load them, but if they get written back out, write them as V2 tags.

This would be no different than if the user added tags to a file since the user doesn't have a way to specify whether V1 or V2 tags are written.  V2 tags are simply always written.

Leland
Comment 3 Gale Andrews 2011-02-28 23:16:52 UTC
(In reply to comment #2)
Leland, thanks for the fix. I had confirmed the fix worked OK on Windows 7 before I read this.   

> There's actually a "bug" in the TagsEditor::TransferDataFromWindow() that
> doesn't maintain the V2 flag properly.  It clears the tags and then 
> repopulates them from the data in the dialog, but that clear also resets 
> the V2 flag to TRUE, even if it was FALSE.  So, that will need to be 
> corrected as well. However, why bother worrying about whether the input
> file had only V1 tags or not?  Sure, go ahead and load them, but if they
> get written back out, write them as V2 tags.
> 
> This would be no different than if the user added tags to a file since the 
> user doesn't have a way to specify whether V1 or V2 tags are written.  V2 
> tags are simply always written.
I thought we only wrote v2 tags even now, because there are a small mumber of complaints that none of our tags are visible in apps that only read v1. Or is that only true if Audacity wrote the tags in the first place, i.e. if Audacity imported v1 tags then it would write those tags as v1? 

I think only writing v2 is fine, as long as Audacity can correctly "convert" imported v1 tags to v2. People can use command line export if they must have v1 tags (could you sometime add that dropdown to Specify Commmand Line Encoder to store entries, like we talked about before)? 

If we only write v2, can we ignore the bug in TagsEditor::TransferDataFromWindow() ?
Comment 4 Leland Lucius 2011-03-01 01:02:41 UTC
(In reply to comment #3)

The only time Audacity will write ID3V1 tags is if a file is imported that contains ID3V1 tags.  That is the only time that the ID3V2 flag is turned off.  If I remove the check for V1 tags on import, then V2 tags will always be written.

And yes, if the imported file contains V1 tags, then libid3tag will automatically convert those to V2 tags automatically.

I will commit a change that will remove V1 writing altogether so you can give it a try.  We can always revert it if need be.

Doing so will still correct this bug as well as bug #225.

Leland
Comment 5 Gale Andrews 2011-03-01 22:24:34 UTC
DEVEL-FIX MADE. r10979 removes any writing of ID3V1 tags. ID3V1 tags will still be imported, but they will be written as ID3V2 tags.
Comment 6 Gale Andrews 2011-03-04 05:33:41 UTC
I think this is fixed now - tested on Windows and Ubuntu. Changing to RESOLVED - FIXED.