Package org.apache.photark

Examples of org.apache.photark.Image


    @Test
    public void testDiscoverAlbums() {
        Entry<String, Image>[] images = photoStream.getAll();

        for(Entry<String, Image> image : images) {
            Image i = image.getData();

            System.out.println(">>>>>>>>>>>>>");
            System.out.println(">> ID       : " + i.getId());
            System.out.println(">> Title    : " + i.getTitle());
            System.out.println(">> Location : " + i.getLocation());
        }
    }
View Full Code Here


public class ImageMetadataScannerTestCase {

    @Test
    public void testMetadataScanner() throws URISyntaxException {
        File imageFile = new File(ImageMetadataScannerTestCase.class.getClassLoader().getResource("gallery-home/album-1/IMG_0735.jpg").toURI());
        Image image = new Image(imageFile, new Date());
        Assert.assertNotNull(image.getImageMetadata());
        Assert.assertTrue(image.getImageMetadata().size() > 0);
        /* for debug purpose
        for(ImageMetadata metadata : image.getImageMetadata()) {
            System.out.println(">>" + metadata.getKey() + "\t" + metadata.getValue());
        }
        */
 
View Full Code Here


        try {
            AlbumFeed feed = picasaService.getFeed(new URL(feedURI), AlbumFeed.class);
            for(PhotoEntry photo : feed.getPhotoEntries()) {
                Image image = fromEntry(photo);
                images.add(new Entry(image.getId(), image));
            }
        } catch (MalformedURLException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (IOException e) {
View Full Code Here

            logger.log(Level.FINEST, ">> ID : " + photo.getId());
            logger.log(Level.FINEST, ">> Title : " + photo.getTitle().getPlainText());
            logger.log(Level.FINEST, ">> Link : " + photo.getLinks().get(0).getHref());
        }

        Image image = new Image();

        // further documentation available at
        // http://code.google.com/apis/picasaweb/docs/2.0/developers_guide_java.html

        image.setId(photo.getGphotoId());
        image.setName(photo.getTitle().getPlainText());
        image.setTitle(photo.getTitle().getPlainText());
        image.setLocation(photo.getMediaContents().get(0).getUrl());

        return image;
    }
View Full Code Here

    @Test
    public void testDiscoverAlbums() {
        Entry<String, Image>[] images = photoStream.getAll();

        for(Entry<String, Image> image : images) {
            Image i = image.getData();

            System.out.println(">>>>>>>>>>>>>");
            System.out.println(">> ID       : " + i.getId());
            System.out.println(">> Title    : " + i.getTitle());
            System.out.println(">> Location : " + i.getLocation());
        }
    }
View Full Code Here

          if (isArchive(inStream)) {
            ArchiveFileExtractor archiveFileExtractor = new ArchiveFileExtractor(supportedImageTypes);
            pictures = archiveFileExtractor.extractArchive(inStream);
          } else {
            // this is a picture file and not the archive file
            Image picture = new Image(fileName, new Date(), inStream);
            pictures.add(picture);
          }

          for (Image picture : pictures) {
            addPictureToAlbum(albumName,albumDescription, picture,request)//todo
View Full Code Here

                     throw new IllegalArgumentException("Error parsing feed: " + e.getMessage());
                 }

                 images = new ArrayList<Entry<String, Image>>();
                 for (org.apache.abdera.model.Entry feedEntry : feed.getEntries()) {
                     Image image = fromEntry(feedEntry);
                     images.add(new Entry<String, Image>(image.getName(), image));
                }

            } else {
                throw new IllegalArgumentException("Invalid photo stream uri:" + feedURI);
            }
View Full Code Here

            logger.log(Level.FINEST, ">> ID : " + entry.getId().toString());
            logger.log(Level.FINEST, ">> Title : " + entry.getTitle());
            logger.log(Level.FINEST, ">> Link : " + entry.getEnclosureLinkResolvedHref().toString());
        }

        Image image = new Image();
        String id = entry.getId().toString();
        image.setId(id.substring(id.lastIndexOf("/") + 1));
        image.setTitle(entry.getTitle());
        image.setLocation(entry.getEnclosureLinkResolvedHref().toString());

        return image;
    }
View Full Code Here

        for (Album album : albums) {
            String[] pictures = album.getPictures();


            for (String picture : pictures) {
                imageAdded(album.getName(), new Image(picture, new GregorianCalendar().getTime(), null));
            }

        }

    }
View Full Code Here

public class ImageMetadataScannerTestCase {

    @Test
    public void testMetadataScanner() throws URISyntaxException {
        File imageFile = new File(ImageMetadataScannerTestCase.class.getClassLoader().getResource("gallery-home/album-1/IMG_0735.jpg").toURI());
        Image image = new Image(imageFile, new Date());
        Assert.assertNotNull(image.getImageMetadata());
        Assert.assertTrue(image.getImageMetadata().size() > 0);
        /* for debug purpose
        for(ImageMetadata metadata : image.getImageMetadata()) {
            System.out.println(">>" + metadata.getKey() + "\t" + metadata.getValue());
        }
        */
 
View Full Code Here

TOP

Related Classes of org.apache.photark.Image

Copyright © 2018 www.massapicom. 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.