Examples of CoverArt


Examples of com.pugh.sockso.music.CoverArt

    }

    public void testGetCoverArt() throws Exception {
        String itemName = "al123";
        BufferedImage image = ImageIO.read(new File("test/data/covers/" + itemName + ".jpg"));
        CoverArt coverArt = new CoverArt(itemName, image);

        cache.addToCache(coverArt);

        CoverArt result = cache.getCoverArt(itemName);
        assertEquals(coverArt.getItemName(), result.getItemName());
        assertNotNull(coverArt.getImage());
        assertNotNull(result.getImage());
    }
View Full Code Here

Examples of com.pugh.sockso.music.CoverArt

    protected void serveLocalCover( final String itemName, final String localPath ) throws IOException, CacheException {

        final Properties p = getProperties();
        final BufferedImage originalImage = ImageIO.read( new File( localPath ) );
        final CoverArt cover = new CoverArt(itemName, originalImage);

        cover.scale(
                (int) p.get(Constants.DEFAULT_ARTWORK_WIDTH, 115),
                (int) p.get(Constants.DEFAULT_ARTWORK_HEIGHT, 115));

        // only cache local cover images if we've been explicitly
        // told to do so (improves performance)
View Full Code Here

Examples of com.pugh.sockso.music.CoverArt

    public boolean serveCover( final String itemName ) throws IOException, CacheException {

        if ( !getProperties().get(Constants.COVERS_DISABLE_REMOTE_FETCHING).equals(Properties.YES) ) {

            final CoverArt cover = search.getCover(itemName);

            if ( cover != null ) {
                serveCover( cover, itemName, true );
                return true;
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.