Author Topic: I can't get picture form the tags of ID3v2  (Read 1916 times)

asight

  • Posts: 9
i will speak simply to make my problem clear, I use c# to get the embeded picture like this:
1. Un4seen.Bass.AddOn.Tags.TagPicture.LoadImageFromFile()
2. Un4seen.Bass.AddOn.Tags.BassTags.BASS_TAG_GetFromFile()
It is confirmed that the picture is in the Id3v2 tags, but i can't get it , whether i should use Bass.BASS_ChannelGetTags() to get the IntPtr and use it to point to "APIC" item? :-\

radio42

  • Posts: 4576
Re: I can't get picture form the tags of ID3v2
« Reply #1 on: 9 Nov '10 - 12:55 »
With the 1. line you would manually create an image from a file - nothing more.
The 2. line would actually read the TAGs from a file.
Cn you please post your full code on how you retrieve your TAGs...

asight

  • Posts: 9
Re: I can't get picture form the tags of ID3v2
« Reply #2 on: 10 Nov '10 - 04:30 »
Code: [Select]
string[] s = Bass.BASS_ChannelGetTagsAPE(channelHandle);
            if (s != null)
                MessageBox.Show("APE available");

            TagPicture[] pics = Bass.BASS_ChannelGetTagsAPEPictures(channelHandle);
            if (pics != null)
                MessageBox.Show("tagPic available");

            string[] id3v2 = Bass.BASS_ChannelGetTagsID3V2(channelHandle);
            if (id3v2 != null)
                MessageBox.Show("id3v2");

            string[] id3v1 = Bass.BASS_ChannelGetTagsID3V1(channelHandle);
            if (id3v1 != null)
                MessageBox.Show("id3v1");

            Image image = Un4seen.Bass.AddOn.Tags.TagPicture.LoadImageFromFile("D:\\#ForAppTest#\\WithImage1.mp3");
            if (image == null)
                MessageBox.Show("cant find pic in loadimagefromfile");

            IntPtr pTags = Bass.BASS_ChannelGetTags(channelHandle, BASSTag.BASS_TAG_ID3V2);
If I get the TAG_INFO structure, the ImageCount always equals 0 and the returned image always equals null.
I use those to test for getting picture, but failed.
I'm a English beginner, c# programming beginer,I'm sorry if i made misktakes on the post.
« Last Edit: 10 Nov '10 - 05:01 by asight »

asight

  • Posts: 9
Re: I can't get picture form the tags of ID3v2
« Reply #3 on: 13 Nov '10 - 03:19 »
it looks like that nobody can solve my problem,its bug? :o

radio42

  • Posts: 4576
Re: I can't get picture form the tags of ID3v2
« Reply #4 on: 13 Nov '10 - 13:44 »
No its not a bug.
The methods you are using just don't deliver any picture tags.

Try to take a look to the Bass.Net docs and watch out for the AddOns.Tags namespace - there you'll find a method called "BassTags.BASS_TAG_GetFromFile" - that's the one you shouold use.
Samples are in the docs.

asight

  • Posts: 9
Re: I can't get picture form the tags of ID3v2
« Reply #5 on: 18 Nov '10 - 14:47 »
Thank you very much , I get  the picture, but i have 2 mp3 files with image, only one can be refrenced, the other is null.
I will try more, thank you.