Results 1 to 22 of 22

Thread: Id3v2 tag APIC solved

  1. #1

    Thread Starter
    Lively Member matt3011's Avatar
    Join Date
    May 2002
    Location
    France
    Posts
    82

    Id3v2 tag APIC solved

    I know how to retrieve the mime-type, the picture type, the description and the picture data. But how can i paint the picture ? I tried to save the data to a file, but it doesn't work...
    Thanks in advance for any help.
    Last edited by matt3011; Sep 21st, 2002 at 12:56 AM.

  2. #2
    PowerPoster
    Join Date
    Aug 2002
    Location
    NY, NY
    Posts
    2,139
    To paint a picture use PaintPicture method.

  3. #3
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808
    Originally posted by IROY55
    To paint a picture use PaintPicture method.
    I don't think that would be of much help... since the information he has might not be compatible with PaintPicture.

    Paste all the info in a file and try to rename it to .jpg, or .gif (I guess that would be the target types) and see if any Image Viewer can open it. That could give us a clue about the type of the fiel we're dealing with.
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  4. #4
    PowerPoster
    Join Date
    Aug 2002
    Location
    NY, NY
    Posts
    2,139
    He asked a specific question: how to paint a puicture? I gave him an answer. So I am not sure why would you say that it "wouldn't be of much help... "

  5. #5
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808
    Originally posted by IROY55
    He asked a specific question: how to paint a puicture? I gave him an answer. So I am not sure why would you say that it "wouldn't be of much help... "
    Simple:

    PaintPicture Method


    Draws the contents of a graphics file (.bmp, .wmf, .emf, .cur, .ico, or .dib) on a Form, PictureBox, or Printer. Doesn't supportnamed arguments.

    Syntax

    object.PaintPicture picture, x1, y1, width1, height1, x2, y2, width2, height2, opcode
    I guess MP3 files would save the image in a compress format like JPG or even GIF. None of those extension would be suitable for PaintPicture. You might need to convert them before trying to use it.
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  6. #6
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808

    Re: Id3v2 tag APIC

    Originally posted by matt3011
    I know how to retrieve the mime-type, the picture type....
    Ok, it seems you already have this, so... what's the type of the picture?
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  7. #7

    Thread Starter
    Lively Member matt3011's Avatar
    Join Date
    May 2002
    Location
    France
    Posts
    82
    Windows media player save it as image/bmp.
    When i open the picture with psp7, i only have (bottom) part of the image. Don't know why. I make a link for my .bas
    Attached Files Attached Files

  8. #8
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808
    A simple comment about this:

    VB Code:
    1. Public Type Id3v1                 'This type is standard for
    2. Title As String * 30            ' Id3 Tags
    3. Artist As String * 30           ' Although later versions
    4. Album As String * 30            ' use comments for 28 bytes
    5. sYear  As String * 4            ' and they use the 2 remaining  bytes for "TrackNumber"!
    6. Comments As String * 30
    7. Genre As Byte
    8. End Type
    The remark about the comments is wrong. You need 28 bytes for the comments, a Chr(0) and a byte to set the track number (so you can set the track number up to 255)
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  9. #9
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808
    Ok, I can see in the GetID3 function that you have this code:

    VB Code:
    1. Open "dessin.bmp" For Binary As #2
    2. Put #2, , picture_data
    3. Close #2

    Can you post a zipped copy of this file so that I can see it?
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  10. #10

    Thread Starter
    Lively Member matt3011's Avatar
    Join Date
    May 2002
    Location
    France
    Posts
    82
    The file doesn't exists originaly. It's the file i extract from the tag. I can't post the file i exctracted from my mp3, it's too large 140ko compressed

  11. #11
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808
    I know that the file was extracted from it. I wanted to see if I can open it. Can you upload it to any server?
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  12. #12
    PowerPoster
    Join Date
    Aug 2002
    Location
    NY, NY
    Posts
    2,139
    McBrain,
    I think you are missing something: by using PaintPicture you may practically load any type of image as long as Picturebox supportes it. Try this:
    Picture1.AutoRedraw = True
    Picture1.PaintPicture LoadPicture("c:\somefile.jpg"), 0, 0, Picture1.ScaleWidth, Picture1.ScaleHeight

  13. #13
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808
    Winrar might compressed to better. Or you can also split the file into two files.
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  14. #14

    Thread Starter
    Lively Member matt3011's Avatar
    Join Date
    May 2002
    Location
    France
    Posts
    82
    I do can open it with psp.
    Here is a link to the file :
    Last edited by matt3011; Oct 15th, 2002 at 11:43 AM.

  15. #15
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808
    Originally posted by IROY55
    McBrain,
    I think you are missing something: by using PaintPicture you may practically load any type of image as long as Picturebox supportes it. Try this:
    Picture1.AutoRedraw = True
    Picture1.PaintPicture LoadPicture("c:\somefile.jpg"), 0, 0, Picture1.ScaleWidth, Picture1.ScaleHeight
    I haven't tried it. I thought what the MSDN should be true.
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  16. #16
    PowerPoster
    Join Date
    Aug 2002
    Location
    NY, NY
    Posts
    2,139
    Don't bet on MSDN too much

  17. #17
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808
    If that's the file you get you can try with Iroy's code. Actually you don't even need the PaintPicture:

    VB Code:
    1. Option Explicit
    2.  
    3. Private Sub Form_Load()
    4.     Picture1.AutoRedraw = True
    5.     Picture1.Picture = LoadPicture("C:\dessin.bmp")
    6. End Sub
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  18. #18
    PowerPoster
    Join Date
    Aug 2002
    Location
    NY, NY
    Posts
    2,139
    PaintPicture is very usefull when you need to resize image to fit Picturebox's size, otherwise I agree: LoadPicture will do the job.

  19. #19

    Thread Starter
    Lively Member matt3011's Avatar
    Join Date
    May 2002
    Location
    France
    Posts
    82
    Actually, i found that the error isn't from painting picture but, i don't retieve enough data with my function.
    I tried to modify the frame size manually and i can extract the entire file and paint it.
    I don't know why the frame size calculated doesn't correspond to the actual size of the frame.

  20. #20

    Thread Starter
    Lively Member matt3011's Avatar
    Join Date
    May 2002
    Location
    France
    Posts
    82
    I found the problem. Frame size was calculated like ID3Tag size, but it shouldn't be.

  21. #21
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808
    GR8!!

    Is it working now?
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  22. #22

    Thread Starter
    Lively Member matt3011's Avatar
    Join Date
    May 2002
    Location
    France
    Posts
    82
    Yes it works pretty well,
    I have a lot of work to do on this bas but I thonk it is a good start
    Here is my .bas
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width