Closed stve closed 7 years ago
Hi @stve,
I add artwork like this https://github.com/mro/internet-radio-recorder/blob/master/src/enclosure-tag-cmd/tag.go#L94 and Finder©®™ loves it. As far as I can see, I just removed the 'description' (for reasons I can't remember).
Hope this helps.
The track initially was tagged incorrectly. That's why id3v2
read it not as expected.
So at first you should delete all frames in mp3 file. Just execute this:
package main
import (
"log"
"github.com/bogem/id3v2"
)
func main() {
filename := "Blure - Branches.mp3"
// Open file and find tag in it
tag, err := id3v2.Open(filename)
if err != nil {
log.Fatal("error opening mp3 file", err)
}
defer tag.Close()
tag.DeleteAllFrames()
if err = tag.Save(); err != nil {
log.Fatal("Error while saving a tag:", err)
}
}
and then execute addPicture.go
. Everything will work fine:
That did the trick, thanks @bogem!
@stve, you are welcome!
I've been working on a command line utility to replace a bunch of Ruby scripts i've had to modify mp3 tags/artwork/etc and your library has made this a breeze - thanks!
All has been working great but I've been having some difficulty setting the artwork on a file. Basically, the problem i'm seeing is that there appears to be a discrepancy between
bogem/id3v2
and what taglib is showing. Here's what i'm observing:I have an image which I've added to my mp3 using the following code:
As best I can tell, the attachment has been added. However, Finder (i'm on a mac) wasn't showing the cover on the file in Preview. That was my first indication that something wasn't right so I started to dig a little deeper. I made a few scripts in Ruby and Go to see what frames are included and this is where I'm seeing a difference.
Using Go:
Using Ruby (taglib):
Using
exiftool
:If the file were to include an image, we'd see something like the following:
As you can see, the only way that I'm able to see evidence of an
APIC
frame is with my Go code. Am I doing something incorrectly when adding the picture frame? I'm fairly new to Go so it's entirely possible that this is something i'm doing incorrectly.I created an example repository here with pared down versions of the scripts i've been using and the files from the above examples. Thanks!