Permalink
Browse files

Merge pull request #38 from habuma/master

SOCIALFB-76 fix
  • Loading branch information...
2 parents 0e4c129 + 3bad1ff commit d0053aa7b28518a3d4b53cb7780cff294aa9af76 @habuma habuma committed Apr 30, 2012
@@ -42,31 +42,15 @@
private List<Tag> tags;
- private Image oversizedImage;
-
- private Image sourceImage;
-
- private Image smallImage;
-
- private Image albumImage;
-
- private Image tinyImage;
+ private List<Image> images;
private Photo(String id, Reference from, String link, String icon, Date createdTime, List<Image> images) {
this.id = id;
this.from = from;
this.link = link;
this.icon = icon;
this.createdTime = createdTime;
-
- int i=0;
- if(images.size() == 5) {
- this.oversizedImage = images.get(i++);
- }
- this.sourceImage = images.get(i++);
- this.albumImage = images.get(i++);
- this.smallImage = images.get(i++);
- this.tinyImage = images.get(i++);
+ this.images = images;
}
public String getId() {
@@ -100,28 +84,29 @@ public Date getCreatedTime() {
public Date getUpdatedTime() {
return updatedTime;
}
+
+ public List<Image> getImages() {
+ return images;
+ }
- /**
- * An oversized image. May be null if no oversized image was provided.
- */
public Image getOversizedImage() {
- return oversizedImage;
+ return images.get(0);
}
public Image getSourceImage() {
- return sourceImage;
+ return images.get(1);
}
public Image getSmallImage() {
- return smallImage;
+ return images.get(6);
}
public Image getAlbumImage() {
- return albumImage;
+ return images.get(5);
}
public Image getTinyImage() {
- return tinyImage;
+ return images.get(7);
}
public List<Tag> getTags() {
@@ -339,18 +339,19 @@ private void assertPhotos(List<Photo> photos) {
assertEquals("Craig Walls", photos.get(0).getFrom().getName());
assertNull(photos.get(0).getName());
assertNull(photos.get(0).getTags());
- assertEquals("http://a5.sphotos.ak.fbcdn.net/hphotos-ak-snc6/200110_10150447271355580_738140579_17698198_7684114_n.jpg", photos.get(0).getSourceImage().getSource());
+ assertEquals(8, photos.get(0).getImages().size());
+ assertEquals("https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-snc6/200110_10150447271355580_738140579_17698198_7684114_n.jpg", photos.get(0).getSourceImage().getSource());
assertEquals(400, photos.get(0).getSourceImage().getWidth());
assertEquals(300, photos.get(0).getSourceImage().getHeight());
- assertEquals("http://photos-e.ak.fbcdn.net/hphotos-ak-snc6/200110_10150447271355580_738140579_17698198_7684114_s.jpg", photos.get(0).getSmallImage().getSource());
+ assertEquals("https://fbcdn-photos-a.akamaihd.net/hphotos-ak-snc6/200110_10150447271355580_738140579_17698198_7684114_s.jpg", photos.get(0).getSmallImage().getSource());
assertEquals(130, photos.get(0).getSmallImage().getWidth());
assertEquals(97, photos.get(0).getSmallImage().getHeight());
- assertEquals("http://photos-e.ak.fbcdn.net/hphotos-ak-snc6/200110_10150447271355580_738140579_17698198_7684114_a.jpg", photos.get(0).getAlbumImage().getSource());
+ assertEquals("https://fbcdn-photos-a.akamaihd.net/hphotos-ak-snc6/200110_10150447271355580_738140579_17698198_7684114_a.jpg", photos.get(0).getAlbumImage().getSource());
assertEquals(180, photos.get(0).getAlbumImage().getWidth());
assertEquals(135, photos.get(0).getAlbumImage().getHeight());
- assertEquals("http://photos-e.ak.fbcdn.net/hphotos-ak-snc6/200110_10150447271355580_738140579_17698198_7684114_t.jpg", photos.get(0).getTinyImage().getSource());
- assertEquals(75, photos.get(0).getTinyImage().getWidth());
- assertEquals(56, photos.get(0).getTinyImage().getHeight());
+ assertEquals("https://fbcdn-photos-a.akamaihd.net/hphotos-ak-snc6/s75x225/200110_10150447271355580_738140579_17698198_7684114_s.jpg", photos.get(0).getTinyImage().getSource());
+ assertEquals(130, photos.get(0).getTinyImage().getWidth());
+ assertEquals(97, photos.get(0).getTinyImage().getHeight());
assertEquals("http://www.facebook.com/photo.php?pid=17698198&id=738140578", photos.get(0).getLink());
assertEquals("http://static.ak.fbcdn.net/rsrc.php/v1/yz/r/StEh3RhPvjk.gif", photos.get(0).getIcon());
assertEquals(1, (int) photos.get(0).getPosition());
@@ -387,18 +388,19 @@ private void assertSinglePhoto(Photo photo) {
assertEquals("Craig Walls", photo.getTags().get(0).getName());
assertEquals((Integer) 47, photo.getTags().get(0).getX());
assertEquals((Integer) 24, photo.getTags().get(0).getY());
- assertEquals("http://a5.sphotos.ak.fbcdn.net/hphotos-ak-snc6/200110_10150447271355580_738140579_17698198_7684115_n.jpg", photo.getSourceImage().getSource());
+ assertEquals(8, photo.getImages().size());
+ assertEquals("https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-snc6/200110_10150447271355580_738140579_17698198_7684115_n.jpg", photo.getSourceImage().getSource());
assertEquals(400, photo.getSourceImage().getWidth());
assertEquals(300, photo.getSourceImage().getHeight());
- assertEquals("http://photos-e.ak.fbcdn.net/hphotos-ak-snc6/200110_10150447271355580_738140579_17698198_7684115_s.jpg", photo.getSmallImage().getSource());
+ assertEquals("https://fbcdn-photos-a.akamaihd.net/hphotos-ak-snc6/200110_10150447271355580_738140579_17698198_7684115_s.jpg", photo.getSmallImage().getSource());
assertEquals(130, photo.getSmallImage().getWidth());
assertEquals(97, photo.getSmallImage().getHeight());
- assertEquals("http://photos-e.ak.fbcdn.net/hphotos-ak-snc6/200110_10150447271355580_738140579_17698198_7684115_a.jpg", photo.getAlbumImage().getSource());
+ assertEquals("https://fbcdn-photos-a.akamaihd.net/hphotos-ak-snc6/200110_10150447271355580_738140579_17698198_7684115_a.jpg", photo.getAlbumImage().getSource());
assertEquals(180, photo.getAlbumImage().getWidth());
assertEquals(135, photo.getAlbumImage().getHeight());
- assertEquals("http://photos-e.ak.fbcdn.net/hphotos-ak-snc6/200110_10150447271355580_738140579_17698198_7684115_t.jpg", photo.getTinyImage().getSource());
- assertEquals(75, photo.getTinyImage().getWidth());
- assertEquals(56, photo.getTinyImage().getHeight());
+ assertEquals("https://fbcdn-photos-a.akamaihd.net/hphotos-ak-snc6/s75x225/200110_10150447271355580_738140579_17698198_7684115_s.jpg", photo.getTinyImage().getSource());
+ assertEquals(130, photo.getTinyImage().getWidth());
+ assertEquals(97, photo.getTinyImage().getHeight());
assertEquals("http://www.facebook.com/photo.php?pid=17698198&id=738140579", photo.getLink());
assertEquals("http://static.ak.fbcdn.net/rsrc.php/v1/yz/r/StEh3RhPvjl.gif", photo.getIcon());
assertEquals(2, (int) photo.getPosition());
@@ -23,29 +23,48 @@
"source":"http:\/\/a5.sphotos.ak.fbcdn.net\/hphotos-ak-snc6\/200110_10150447271355580_738140579_17698198_7684115_n.jpg",
"height":300,
"width":400,
- "images":
- [
- {
- "height":300,
- "width":400,
- "source":"http:\/\/a5.sphotos.ak.fbcdn.net\/hphotos-ak-snc6\/200110_10150447271355580_738140579_17698198_7684115_n.jpg"
- },
- {
- "height":135,
- "width":180,
- "source":"http:\/\/photos-e.ak.fbcdn.net\/hphotos-ak-snc6\/200110_10150447271355580_738140579_17698198_7684115_a.jpg"
- },
- {
- "height":97,
- "width":130,
- "source":"http:\/\/photos-e.ak.fbcdn.net\/hphotos-ak-snc6\/200110_10150447271355580_738140579_17698198_7684115_s.jpg"
- },
- {
- "height":56,
- "width":75,
- "source":"http:\/\/photos-e.ak.fbcdn.net\/hphotos-ak-snc6\/200110_10150447271355580_738140579_17698198_7684115_t.jpg"
- }
- ],
+ "images": [
+ {
+ "width": 2048,
+ "height": 1536,
+ "source": "https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-snc6/s2048x2048/200110_10150447271355580_738140579_17698198_7684115_n.jpg"
+ },
+ {
+ "width": 400,
+ "height": 300,
+ "source": "https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-snc6/200110_10150447271355580_738140579_17698198_7684115_n.jpg"
+ },
+ {
+ "width": 400,
+ "height": 300,
+ "source": "https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-snc6/200110_10150447271355580_738140579_17698198_7684115_n.jpg"
+ },
+ {
+ "width": 480,
+ "height": 360,
+ "source": "https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-snc6/s480x480/200110_10150447271355580_738140579_17698198_7684115_n.jpg"
+ },
+ {
+ "width": 320,
+ "height": 240,
+ "source": "https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-snc6/s320x320/200110_10150447271355580_738140579_17698198_7684115_n.jpg"
+ },
+ {
+ "width": 180,
+ "height": 135,
+ "source": "https://fbcdn-photos-a.akamaihd.net/hphotos-ak-snc6/200110_10150447271355580_738140579_17698198_7684115_a.jpg"
+ },
+ {
+ "width": 130,
+ "height": 97,
+ "source": "https://fbcdn-photos-a.akamaihd.net/hphotos-ak-snc6/200110_10150447271355580_738140579_17698198_7684115_s.jpg"
+ },
+ {
+ "width": 130,
+ "height": 97,
+ "source": "https://fbcdn-photos-a.akamaihd.net/hphotos-ak-snc6/s75x225/200110_10150447271355580_738140579_17698198_7684115_s.jpg"
+ }
+ ],
"link":"http:\/\/www.facebook.com\/photo.php?pid=17698198&id=738140579",
"icon":"http:\/\/static.ak.fbcdn.net\/rsrc.php\/v1\/yz\/r\/StEh3RhPvjl.gif",
"created_time":"2011-03-24T21:36:06+0000",
@@ -13,29 +13,48 @@
"source":"http:\/\/a5.sphotos.ak.fbcdn.net\/hphotos-ak-snc6\/200110_10150447271355580_738140579_17698198_7684114_n.jpg",
"height":300,
"width":400,
- "images":
- [
- {
- "height":300,
- "width":400,
- "source":"http:\/\/a5.sphotos.ak.fbcdn.net\/hphotos-ak-snc6\/200110_10150447271355580_738140579_17698198_7684114_n.jpg"
- },
- {
- "height":135,
- "width":180,
- "source":"http:\/\/photos-e.ak.fbcdn.net\/hphotos-ak-snc6\/200110_10150447271355580_738140579_17698198_7684114_a.jpg"
- },
- {
- "height":97,
- "width":130,
- "source":"http:\/\/photos-e.ak.fbcdn.net\/hphotos-ak-snc6\/200110_10150447271355580_738140579_17698198_7684114_s.jpg"
- },
- {
- "height":56,
- "width":75,
- "source":"http:\/\/photos-e.ak.fbcdn.net\/hphotos-ak-snc6\/200110_10150447271355580_738140579_17698198_7684114_t.jpg"
- }
- ],
+ "images": [
+ {
+ "width": 2048,
+ "height": 1536,
+ "source": "https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-snc6/s2048x2048/200110_10150447271355580_738140579_17698198_7684114_n.jpg"
+ },
+ {
+ "width": 400,
+ "height": 300,
+ "source": "https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-snc6/200110_10150447271355580_738140579_17698198_7684114_n.jpg"
+ },
+ {
+ "width": 400,
+ "height": 300,
+ "source": "https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-snc6/200110_10150447271355580_738140579_17698198_7684114_n.jpg"
+ },
+ {
+ "width": 480,
+ "height": 360,
+ "source": "https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-snc6/s480x480/200110_10150447271355580_738140579_17698198_7684114_n.jpg"
+ },
+ {
+ "width": 320,
+ "height": 240,
+ "source": "https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-snc6/s320x320/200110_10150447271355580_738140579_17698198_7684114_n.jpg"
+ },
+ {
+ "width": 180,
+ "height": 135,
+ "source": "https://fbcdn-photos-a.akamaihd.net/hphotos-ak-snc6/200110_10150447271355580_738140579_17698198_7684114_a.jpg"
+ },
+ {
+ "width": 130,
+ "height": 97,
+ "source": "https://fbcdn-photos-a.akamaihd.net/hphotos-ak-snc6/200110_10150447271355580_738140579_17698198_7684114_s.jpg"
+ },
+ {
+ "width": 130,
+ "height": 97,
+ "source": "https://fbcdn-photos-a.akamaihd.net/hphotos-ak-snc6/s75x225/200110_10150447271355580_738140579_17698198_7684114_s.jpg"
+ }
+ ],
"link":"http:\/\/www.facebook.com\/photo.php?pid=17698198&id=738140578",
"icon":"http:\/\/static.ak.fbcdn.net\/rsrc.php\/v1\/yz\/r\/StEh3RhPvjk.gif",
"created_time":"2011-03-24T21:36:06+0000",
@@ -67,29 +86,48 @@
"source":"http:\/\/a5.sphotos.ak.fbcdn.net\/hphotos-ak-snc6\/200110_10150447271355580_738140579_17698198_7684115_n.jpg",
"height":300,
"width":400,
- "images":
- [
- {
- "height":300,
- "width":400,
- "source":"http:\/\/a5.sphotos.ak.fbcdn.net\/hphotos-ak-snc6\/200110_10150447271355580_738140579_17698198_7684115_n.jpg"
- },
- {
- "height":135,
- "width":180,
- "source":"http:\/\/photos-e.ak.fbcdn.net\/hphotos-ak-snc6\/200110_10150447271355580_738140579_17698198_7684115_a.jpg"
- },
- {
- "height":97,
- "width":130,
- "source":"http:\/\/photos-e.ak.fbcdn.net\/hphotos-ak-snc6\/200110_10150447271355580_738140579_17698198_7684115_s.jpg"
- },
- {
- "height":56,
- "width":75,
- "source":"http:\/\/photos-e.ak.fbcdn.net\/hphotos-ak-snc6\/200110_10150447271355580_738140579_17698198_7684115_t.jpg"
- }
- ],
+ "images": [
+ {
+ "width": 2048,
+ "height": 1536,
+ "source": "https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-snc6/s2048x2048/200110_10150447271355580_738140579_17698198_7684115_n.jpg"
+ },
+ {
+ "width": 400,
+ "height": 300,
+ "source": "https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-snc6/200110_10150447271355580_738140579_17698198_7684115_n.jpg"
+ },
+ {
+ "width": 400,
+ "height": 300,
+ "source": "https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-snc6/200110_10150447271355580_738140579_17698198_7684115_n.jpg"
+ },
+ {
+ "width": 480,
+ "height": 360,
+ "source": "https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-snc6/s480x480/200110_10150447271355580_738140579_17698198_7684115_n.jpg"
+ },
+ {
+ "width": 320,
+ "height": 240,
+ "source": "https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-snc6/s320x320/200110_10150447271355580_738140579_17698198_7684115_n.jpg"
+ },
+ {
+ "width": 180,
+ "height": 135,
+ "source": "https://fbcdn-photos-a.akamaihd.net/hphotos-ak-snc6/200110_10150447271355580_738140579_17698198_7684115_a.jpg"
+ },
+ {
+ "width": 130,
+ "height": 97,
+ "source": "https://fbcdn-photos-a.akamaihd.net/hphotos-ak-snc6/200110_10150447271355580_738140579_17698198_7684115_s.jpg"
+ },
+ {
+ "width": 130,
+ "height": 97,
+ "source": "https://fbcdn-photos-a.akamaihd.net/hphotos-ak-snc6/s75x225/200110_10150447271355580_738140579_17698198_7684115_s.jpg"
+ }
+ ],
"link":"http:\/\/www.facebook.com\/photo.php?pid=17698198&id=738140579",
"icon":"http:\/\/static.ak.fbcdn.net\/rsrc.php\/v1\/yz\/r\/StEh3RhPvjl.gif",
"created_time":"2011-03-24T21:36:06+0000",

0 comments on commit d0053aa

Please sign in to comment.