aribhatt91 / flickrj-android

Automatically exported from code.google.com/p/flickrj-android
Other
0 stars 0 forks source link

There's no way to get the width and height for certain image sizes from the Flickr response #14

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Call InterestingnessInterface.getList() with extra "url_z" which corresponds 
to the "medium 640" size.
2. Process the resulting PhotoList and attempt to get the width and height of 
the medium 640 image.

What is the expected output? What do you see instead?
Expected: There should be a way to get the medium 640 image width and height.
Actual: The Photo API supports retrieving the image URL by calling 
Photo.getMedium640Url(), but there's no way to get the width or height of the 
photo that was retrieved without making extra API calls.

What version of the product are you using? On what operating system?
Version: 2.0.7
Operating System: n/a

Please provide any additional information below.
n/a

Original issue reported on code.google.com by mthom...@gmail.com on 16 Aug 2013 at 9:27

GoogleCodeExporter commented 8 years ago
E.g. suppose a response contains this:

      "photo":[
         {
            "id":"8532443967",
            "description" : { "_content" : "Some creative description" },
            "secret":"bedb46f09c",
            "server":"8233",
            "farm":9,
            "title":"IMG_5354",
            "isprimary":"1",
            "dateupload":"1367452900",
            "url_l":"http:\/\/farm9.staticflickr.com\/8233\/8532443967_bedb46f09c_b.jpg",
            "height_l":"768",
            "width_l":"1024",
            "url_n":"http:\/\/farm9.staticflickr.com\/8233\/8532443967_bedb46f09c_n.jpg",
            "height_n":240,
            "width_n":"320",
            "url_z":"http:\/\/farm9.staticflickr.com\/8233\/8532443967_bedb46f09c_z.jpg",
            "height_z":"480",
            "width_z":"640",
            "ownername":"cvsaphotos"
         },

Even though the width and height of the large image are available, these values 
don't seem to be parsed.

photo.getLargeSize().getSource() = 
http://farm9.staticflickr.com/8233/8532443967_bedb46f09c_b.jpg
photo.getLargeSize().getWidth() = 0
photo.getLargeSize().getHeight() = 0

Original comment by mthom...@gmail.com on 16 Aug 2013 at 11:12

GoogleCodeExporter commented 8 years ago
in PhotoUtils, method createPhoto

there are sections dealing with sizes e.g.

        urlTmp = photoElement.optString("url_l");
        if (urlTmp.startsWith("http")) {
            Size sizeT = new Size();
            sizeT.setLabel(Size.LARGE);
            sizeT.setSource(urlTmp);
            sizes.add(sizeT);
        }

there is no setWidth and setHeight called on sizeT object ... it would be nice 
if sizes were set there

Original comment by norbert....@gmail.com on 18 Aug 2013 at 11:32

GoogleCodeExporter commented 8 years ago
Yes sorry, so this is really 2 issues:

1) setWidth() and setHeight() aren't being called for the Size instances when 
parsing a photo.
2) There's no Size instances available for some of the image sizes (e.g. the 
"medium 640" size). Only an image URL is available.

For 1) there's another API specifically to get the available image sizes of a 
photo, but we'd rather avoid needing to make more API calls if the info is 
already available and just needs to be parsed.

Original comment by mthom...@gmail.com on 19 Aug 2013 at 10:25

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
The first issue was fixed by this pull request: 
https://github.com/yuyang226/FlickrjApi4Android/pull/14

It doesn't address the second issue though.

Thanks!

Best Regards,
Mark

Original comment by mthom...@gmail.com on 3 Sep 2013 at 7:31