dhowden / tag

ID3, MP4 and OGG/FLAC metadata parsing in Go
BSD 2-Clause "Simplified" License
558 stars 72 forks source link

Metadata.Picture() returning invalid image #62

Closed deluan closed 4 years ago

deluan commented 4 years ago

If I try to extract the album art from the attached mp3, I get an invalid image. This is what I get when running tag against the file:

$ tag thoh.mp3
Metadata Format: ID3v2.4
File Type: MP3
 Title: The House Of House (Thomas Schumacher Remix)
 Album: Spiritika 25
 Artist: Cherrymoon Trax
 Composer:
 Genre: Techno
 Year: 2019
 Track: 13 of 0
 Disc: 0 of 0
 Picture: Picture{Ext: , MIMEType: >}, Type: , Description: mage/jpeg, Data.Size: 240139}
 Lyrics:

Note the invalid mime type and description. It's worth to note that I can successfully extract the image with ffmpeg, and iTunes also displays the image with no issues.

thoh.mp3.zip

Thanks

AlphaJack commented 4 years ago

Converting the tags to ID3v2.3 works, it seems to be a problem with ID3v2.4 in MP3. The Data.Size attribute differs:

$ tag thoh.mp3
Metadata Format: ID3v2.3
File Type: MP3
 Title: The House Of House (Thomas Schumacher Remix)
 Album: Spiritika 25
 Artist: Cherrymoon Trax
 Composer:
 Genre: Techno
 Year: 2019
 Track: 13 of 0
 Disc: 0 of 0
 Picture: Picture{Ext: jpg, MIMEType: image/jpeg, Type: Cover (front), Description: , Data.Size: 237423}
 Lyrics:
 Comment:

I've also noticed that both ID3v2.3 and ID3v2.4 can't be read from AIFF files, can you add support for them?

deluan commented 4 years ago

Doesn't seem to be an issue with ALL ID3v2.4 tags. The attached file works as expected:

$ tag jam.mp3
Metadata Format: ID3v2.4
File Type: MP3
 Title: Art School
 Album: Fire & Skill - The Songs Of The Jam
 Artist: Silver Sun
 Composer:
 Genre: Rock
 Year: 1999
 Track: 5 of 12
 Disc: 1 of 1
 Picture: Picture{Ext: jpg, MIMEType: image/jpeg, Type: Cover (front), Description: , Data.Size: 69211}
 Lyrics:

jam.mp3.zip

deluan commented 4 years ago

This was fixed with PR #63 Thanks a lot!

deluan commented 4 years ago

This is working as expected. Not sure if you want me to close the issue, but feel free to do so. Thanks a lot for fixing this