private MetadataBlockDataPicture createMetadataBlockDataPicture(Artwork artwork) throws FieldDataInvalidException {
  if (artwork.isLinked()) {
    return new MetadataBlockDataPicture(Utils.getDefaultBytes(artwork.getImageUrl(),TextEncoding.CHARSET_ISO_8859_1),artwork.getPictureType(),MetadataBlockDataPicture.IMAGE_IS_URL,"",0,0,0,0);
  }
 else {
    if (!artwork.setImageFromData()) {
      throw new FieldDataInvalidException("Unable to create MetadataBlockDataPicture from buffered");
    }
    return new MetadataBlockDataPicture(artwork.getBinaryData(),artwork.getPictureType(),artwork.getMimeType(),artwork.getDescription(),artwork.getWidth(),artwork.getHeight(),0,0);
  }
}

private MetadataBlockDataPicture createMetadataBlockDataPicture ( Artwork artwork ) throws FieldDataInvalidException { if ( artwork . isLinked ( ) ) { return new MetadataBlockDataPicture ( Utils . getDefaultBytes ( artwork . getImageUrl ( ) , TextEncoding . CHARSET_ISO_8859_1 ) , artwork . getPictureType ( ) , MetadataBlockDataPicture . IMAGE_IS_URL , "" , 0 , 0 , 0 , 0 ) ; } else { if ( ! artwork . setImageFromData ( ) ) { throw new FieldDataInvalidException ( "Unable to create MetadataBlockDataPicture from buffered" ) ; } return new MetadataBlockDataPicture ( artwork . getBinaryData ( ) , artwork . getPictureType ( ) , artwork . getMimeType ( ) , artwork . getDescription ( ) , artwork . getWidth ( ) , artwork . getHeight ( ) , 0 , 0 ) ; } }
create metadatablockpicture field , this is the preferred way of storing artwork in vorbiscomment tag now but has to be base encoded to be stored in vorbiscomment
