Skip to content

add_picture method does not work with ruby 1.8 #32

@justindossey

Description

@justindossey

String#force_encoding and Regexp::FIXEDENCODING don't work with ruby 1.8, and both are used in ID3V2::add_picture.

Furthermore, reading an id3v2 tag with an APIC frame fails because iconv blows up on the binary data in the frame. AFAICT, we shouldn't even attempt to decode that data.

Finally, the mime type you set is "jpg" for JPEG, but the spec at http://id3.org/id3v2.3.0#Attached_picture says it should be "image/jpeg" not "image/jpg".

Example exception on reading an mp3 file with an APIC frame:
*** ERROR: "\376\377\000\000\377\376E\000p\000i\000s\000o\000"...; ... ruby-mp3info-0.8.1/lib/mp3info/extension_modules.rb:67:in `iconv'

(same issue occurs with 0.8.2)

I would suggest that if options[:mime] is passed in, you can skip the image format detection fancy stuff.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions