1

I'm trying to display a cover image from an MP3 file. I'm getting the ID3 tags from https://github.com/NiKoTron/dart-tags.

My Code:

TagProcessor tp = TagProcessor();
tp.getTagsFromByteArray(bytes).then((l) async {

  AttachedPicture picture = l[1].tags['picture']['Cover (front)'];

  log(picture.toString()); // ->[log] {mime:image/png, description:, bitmap: iVBORw0KGgoAAAANSUhEUgAABLAAAASw...}
});

The mime: image/png is just a string, so I don't exactly know how to get the image.

1
  • 1
    You're getting the bitmap of the image. Did you try displaying the bitmap? I think Image.memory displays images from a bitmap. Commented Jul 1, 2021 at 12:38

1 Answer 1

1

AttachedPicture has property imageData which is of type List<int>.

You could use Image.memory to display imageData by using Uint8List.fromList.

import 'dart:typed_data';

Image.memory(
  Uint8List.fromList(imageData),
);
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.