Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tag.pictures array is empty #29

Open
adamyonk opened this issue Apr 30, 2013 · 2 comments
Open

tag.pictures array is empty #29

adamyonk opened this issue Apr 30, 2013 · 2 comments

Comments

@adamyonk
Copy link

I'm seeing the following behavior:

> mp3info.tag.pictures
  => []
> mp3info.tag2.PIC
  => "\\0JPG\\<<<...snip...>>>"
@moumar
Copy link
Owner

moumar commented Nov 20, 2013

hello,

did you save the mp3 file before seeing this behaviour ?

thanks

@RStankov
Copy link

hi @moumar

I have the same issue with this mp3:

http://traffic.libsyn.com/zenandtech/melton06.mp3

info.tag.pictures is empty because APIC is empty, but PIC is present.

I have a did a quick fix for my project and seems to work as a charm:

pictures = info.tag2.pictures

if pictures.empty?
  info.tag2['APIC'] = info.tag2['PIC']
  pictures = info.tag2.pictures
end

A possible fix can applied here:

https://github.com/moumar/ruby-mp3info/blob/master/lib/mp3info/id3v2.rb#L280

-- apic_images = [self["APIC"]].flatten.dup
++ apic_images = [Array(self["APIC"]) + Array(self["PIC"])].flatten

I can apply a pull request with this fix, if you think this is good enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants