WavChunkType's `code` is case sensitive

Issue #287 resolved
Dan Gravell created an issue

When the WavChunkType is read for a chunk in a WAV, we look it up using the code:

    public synchronized static WavChunkType get(final String code) {
        if (CODE_TYPE_MAP.isEmpty()) {
            for (final WavChunkType type : values()) {
                CODE_TYPE_MAP.put(type.getCode(), type);
            }
        }
        return CODE_TYPE_MAP.get(code);
    }

This is a case sensitive comparison.

I have noticed the tagger kid3-cli creates chunk type codes with upper case, e.g. "ID3". I looked into this further and it turns out this was the (old) behaviour of a library called Taglib (https://taglib.org/). This is used in a lot of software, e.g. Traktor.

Refs:

I wonder if jaudiotagger should be more tolerant of this?

Comments (5)

  1. IJabz repo owner

    Hi Dan, we do already account for this, if you look at WavChunkType you'll see we have defined ID3_UPPERCASE as well as ID3 (and CORRUPT_ID3_EARLY and CORRUPT_ID3_LATE). If it is not handling such chunks then there is a bug, have you had actually problems reading files ?

  2. Dan Gravell reporter

    Sorry, I'm just on an old version atm. I only searched for an issue, I didn't check the current codebase. I'll close this.

  3. Log in to comment