I'm using JAudioTagger to fetch the metadata from music files, getting the title, year etc is working fine but I am having a problem with getting the cover art. I have not been able to find any examples searching online, any help would be great!
Here is my current code, which the coverArt BufferedImage is showing up as null when debugging. I have checked and the mp3 file has a cover image.
ID3v23Tag id3v23Tag = (ID3v23Tag)tag;
TagField coverArtField =
id3v23Tag.getFirstField(org.jaudiotagger.tag.id3.ID3v23FieldKey.COVER_ART.getFieldName());
FrameBodyAPIC body = (FrameBodyAPIC)((ID3v23Frame)coverArtField).getBody();
byte[] imageRawData = (byte[])body.getObjectValue(DataTypes.OBJ_PICTURE_DATA);
coverArt = ImageIO.read(ImageIO.createImageInputStream(new ByteArrayInputStream(imageRawData)));