Methods Summary |
---|
public static org.jaudiotagger.tag.images.StandardArtwork | createArtworkFromFile(java.io.File file)Create Artwork from File
StandardArtwork artwork = new StandardArtwork();
artwork.setFromFile(file);
return artwork;
|
public static org.jaudiotagger.tag.images.StandardArtwork | createArtworkFromMetadataBlockDataPicture(org.jaudiotagger.audio.flac.metadatablock.MetadataBlockDataPicture coverArt)Create artwork from Flac block
StandardArtwork artwork = new StandardArtwork();
artwork.setFromMetadataBlockDataPicture(coverArt);
return artwork;
|
public static org.jaudiotagger.tag.images.StandardArtwork | createLinkedArtworkFromURL(java.lang.String url)
StandardArtwork artwork = new StandardArtwork();
artwork.setLinkedFromURL(url);
return artwork;
|
public byte[] | getBinaryData()
return binaryData;
|
public java.lang.String | getDescription()
return description;
|
public int | getHeight()
return height;
|
public java.lang.Object | getImage()
ImageInputStream iis = ImageIO.createImageInputStream(new ByteArrayInputStream(getBinaryData()));
BufferedImage bi = ImageIO.read(iis);
return bi;
|
public java.lang.String | getImageUrl()
return imageUrl;
|
public java.lang.String | getMimeType()
return mimeType;
|
public int | getPictureType()
return pictureType;
|
public int | getWidth()
return width;
|
public boolean | isLinked()
return isLinked;
|
public void | setBinaryData(byte[] binaryData)
this.binaryData = binaryData;
|
public void | setDescription(java.lang.String description)
this.description = description;
|
public void | setFromFile(java.io.File file)Create Artwork from File
RandomAccessFile imageFile = new RandomAccessFile(file, "r");
byte[] imagedata = new byte[(int) imageFile.length()];
imageFile.read(imagedata);
imageFile.close();
setBinaryData(imagedata);
setMimeType(ImageFormats.getMimeTypeForBinarySignature(imagedata));
setDescription("");
setPictureType(PictureTypes.DEFAULT_ID);
|
public void | setFromMetadataBlockDataPicture(org.jaudiotagger.audio.flac.metadatablock.MetadataBlockDataPicture coverArt)Populate Artwork from MetadataBlockDataPicture as used by Flac and VorbisComment
setMimeType(coverArt.getMimeType());
setDescription(coverArt.getDescription());
setPictureType(coverArt.getPictureType());
if(coverArt.isImageUrl())
{
setLinked(coverArt.isImageUrl());
setImageUrl(coverArt.getImageUrl());
}
else
{
setBinaryData(coverArt.getImageData());
}
setWidth(coverArt.getWidth());
setHeight(coverArt.getHeight());
|
public void | setHeight(int height)
this.height = height;
|
public boolean | setImageFromData()Should be called when you wish to prime the artwork for saving
try
{
BufferedImage image = (BufferedImage)getImage();
setWidth(image.getWidth());
setHeight(image.getHeight());
}
catch(IOException ioe)
{
return false;
}
return true;
|
public void | setImageUrl(java.lang.String imageUrl)
this.imageUrl = imageUrl;
|
public void | setLinked(boolean linked)
isLinked = linked;
|
public void | setLinkedFromURL(java.lang.String url)Create Linked Artwork from URL
setLinked(true);
setImageUrl(url);
|
public void | setMimeType(java.lang.String mimeType)
this.mimeType = mimeType;
|
public void | setPictureType(int pictureType)
this.pictureType = pictureType;
|
public void | setWidth(int width)
this.width = width;
|