Torsten2217 / google-plus-platform

Automatically exported from code.google.com/p/google-plus-platform
0 stars 0 forks source link

Occasional missing height and width in attachments image #100

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,

The API:
    "attachments": [
      {
        "objectType": string,
        "displayName": string,
        "id": string,
        "content": string,
        "url": string,
        "image": {
          "url": string,
          "type": string,
          "height": unsigned integer,
          "width": unsigned integer

The height and width are missing from the image (fullImage always seem 
spopulated), not always, but in this case they are:

(activity ID z13li51iaojmsdq1h23vtldwwoacifqb504)
    ["attachments"]=>
    array(1) {
      [0]=>
      array(5) {
        ["objectType"]=>
        string(5) "photo"
        ["content"]=>
        string(12) "10/28/11 - 1"
        ["url"]=>
        string(99) "https://plus.google.com/photos/100492888463256600334/albums/5668537346979715169/5668537346978008306"
        ["image"]=>
        array(2) {
          ["url"]=>
          string(230) "http://images0-focus-opensocial.googleusercontent.com/gadgets/proxy?container=focus&gadget=a&resize_h=100&url=https%3A%2F%2Flh6.googleusercontent.com%2F-W46w28_ZTy4%2FTqqwrxKozPI%2FAAAAAAAADwQ%2FkFl_Vp30RiI%2Fs0-d%2F11%252B-%252B1"
          ["type"]=>
          string(10) "image/jpeg"
        }
        ["fullImage"]=>
        array(4) {
          ["url"]=>
          string(98) "https://lh6.googleusercontent.com/-W46w28_ZTy4/TqqwrxKozPI/AAAAAAAADwQ/kFl_Vp30RiI/s0-d/11%2B-%2B1"
          ["type"]=>
          string(10) "image/jpeg"
          ["height"]=>
          int(800)
          ["width"]=>
          int(800)
        }
      }
    }
  }

From a first glance at a couple of results it seems the height & width are 
returned only if the image filename ends with an extension, in the above case 
there's no .jpg 

e.g. activity ID z120f3hgktj0xltky22rgflzypf1cvllg does return height & width

Jeroen van Drie.

Original issue reported on code.google.com by jeroe...@gmail.com on 28 Oct 2011 at 2:24

GoogleCodeExporter commented 9 years ago

Original comment by jch...@google.com on 11 Apr 2012 at 11:47

GoogleCodeExporter commented 9 years ago
I've noticed this issue as well.  I seem to have this problem when the image is 
from an article that was posted (Google+ automatically pulls in an image from 
the page, which is what I want to display).  It seems to occur especially if 
the fullImage.url is not linking directly to an image (I've seen the url of 
fullImage sometimes even be the HTML page itself).

One example I can find is this:

    "attachments": [
     {
      "objectType": "article",
      "displayName": "Pretty in Pink: How Pets Are Helping the Fight Against Breast Cancer",
      "content": "Many are surprised to learn that mammary tumors can make our pets sick, and that the research and development of treatments for our pets can unlock clues about helping people beat breast cancer.",
      "url": "http://www.huffingtonpost.com/natasha-ashton/animal-breast-cancer_b_1920260.html"
     },
     {
      "objectType": "photo",
      "image": {
       "url": "https://images0-focus-opensocial.googleusercontent.com/gadgets/proxy?container=focus&gadget=a&resize_h=100&url=http%3A%2F%2Fi.huffpost.com%2Fgen%2F792228%2Fthumbs%2Fs-GRUMPYCAT-large.jpg",
       "type": "image/jpeg"
      },
      "fullImage": {
       "url": "http://www.huffingtonpost.com/natasha-ashton/animal-breast-cancer_b_1920260.html",
       "type": "image/jpeg"
      }
     }

Original comment by nicholas...@gmail.com on 3 Oct 2012 at 7:13

GoogleCodeExporter commented 9 years ago

Original comment by t...@google.com on 5 Jun 2013 at 1:36

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago

Original comment by t...@google.com on 6 Jun 2013 at 2:58