Skip to content

Commit

Permalink
Makes linked images bigger
Browse files Browse the repository at this point in the history
  • Loading branch information
kjlubick committed Mar 14, 2015
1 parent 2336aa6 commit 3379aa0
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/main/java/edu/ncsu/dlf/utils/ImageUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ public static String uploadPhoto(BufferedImage image) throws IOException {
throw new IOException("Problem uploading photo", e);
}

publicLinkToPhoto = returnedPhoto.getMediaContents().get(0).getUrl();
publicLinkToPhoto = returnedPhoto.getMediaThumbnails().get(0).getUrl();

//scale it up to 800 px, which is the largest we can hotlink to
publicLinkToPhoto = publicLinkToPhoto.replace("/s72/", "/s800/").replace("/s144/", "/s800/").replace("/s288/", "/s800/");
}
return publicLinkToPhoto;
}
Expand All @@ -85,7 +88,7 @@ private static void main(String[] args) throws IOException, ServiceException {

URL feedUrl = new URL("https://picasaweb.google.com/data/feed/api/user/default/albumid/"+pdfAlbumId);

BufferedImage image = ImageIO.read(new File("test.png"));
BufferedImage image = ImageIO.read(new File("test.jpg"));

ByteArrayOutputStream baos = new ByteArrayOutputStream();

Expand All @@ -96,12 +99,6 @@ private static void main(String[] args) throws IOException, ServiceException {
PhotoEntry returnedPhoto = photoService.insert(feedUrl, PhotoEntry.class, myMedia);

System.out.println(returnedPhoto);
System.out.println(returnedPhoto.getId());
System.out.println(returnedPhoto.getHtmlLink());
System.out.println(returnedPhoto.getHtmlLink().getHref());
System.out.println(returnedPhoto.getMediaContents());
System.out.println(returnedPhoto.getMediaContents().get(0));
System.out.println(returnedPhoto.getMediaContents().get(0).getUrl()); //this one works

}

Expand Down

0 comments on commit 3379aa0

Please sign in to comment.