[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to read artwork bitmaps embedded in MP3 files as "image"-Tag
[Thread Prev] | [Thread Next]
- Subject: Re: How to read artwork bitmaps embedded in MP3 files as "image"-Tag
- From: Benoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx>
- Date: Tue, 10 Mar 2026 02:44:24 +0100
- To: user@xxxxxxxxxxxxxxxxxxxxxx
Le 09/03/2026 à 12:37, Claus Dietrich a écrit :
Am 01.03.26 um 18:23 schrieb Claus Dietrich:Am 01.03.26 um 17:59 schrieb Claus Dietrich:HiI am writing a special type of audio file player. The ID3V2 metadata (title/album/artist etc) are read as text inside a _Tag event handling routine.In addidtion to this I also want to read artwork bitmaps embedded as "image"-Tag. How can I do this?Best regards, ClausSorry, I forgot to mention that I am using a MediaPipeline of gb.media and I want to avoid the installation of further cli tools.Brgds, ClausNo reply. So I am concluding that gb.media doesn't support it.I regard this functionality as essential for multimedia applications. Gambas has a very powerful GStreamer implementation which provides all we need - also the image tag. There is just no way to read it.Benoît: If you like to implement it, feel free to use the attached mini app as a basis. It loads down a public domain music track with embedded image (ignore the littered Comment-Tag).
I added in the last commit support for GStreamer "sample" objects, through a new 'MediaSample' class.
The image tag returns such an object, that includes the image contents (returned by the 'Data' property), and some metadata (returned by the 'Info' property).
That metadata is returned as a collection of collections. The contents of these collections can be anything.
In the case of the mp3 I used for testing (not yours), I get that:
{"image/jpeg":{"width":400,"height":400,"sof-marker":2}}
It seems to mean that the image is a JPEG, so you have to use the
'Image.FromString()' method to transform the sample data into an Image
object.
Try it and tell me if you have any problem. Regards, -- Benoît Minisini.
| Re: How to read artwork bitmaps embedded in MP3 files as "image"-Tag | Karl Reinl <karl.reinl@xxxxxxxxxx> |
| Re: How to read artwork bitmaps embedded in MP3 files as "image"-Tag | Claus Dietrich <claus.dietrich@xxxxxxxxxx> |
| How to read artwork bitmaps embedded in MP3 files as "image"-Tag | Claus Dietrich <claus.dietrich@xxxxxxxxxx> |
| Re: How to read artwork bitmaps embedded in MP3 files as "image"-Tag | Claus Dietrich <claus.dietrich@xxxxxxxxxx> |
| Re: How to read artwork bitmaps embedded in MP3 files as "image"-Tag | Claus Dietrich <claus.dietrich@xxxxxxxxxx> |