leichter / cwrx

(Old) Cinema6 API
0 stars 0 forks source link

Collateral service should add some additional metadata to the images array for iOS apps. #953

Closed howardengelhart closed 8 years ago

howardengelhart commented 8 years ago

The product info we pull for IOS apps has an image array that looks like the example below. There are two pieces of data we'd like to add to each item in the array:

  1. File size, this can be retrieved by sending a HEAD request on the URL and inspecting the content-length property of the returned headers.
  2. WidthxHeight in pixels - this can be retrieved by retrieving and inspecting the image file headers (talk to @ScottBouloutian ).
    "images": [
      {
        "uri": "http://a1.mzstatic.com/us/r30/Purple/v4/c2/ec/6b/c2ec6b9a-d47b-20e4-d1f7-2f42fffcb58f/screen1136x1136.jpeg",
        "type": "screenshot",
        "device": "phone"
      },
      {
        "uri": "http://a5.mzstatic.com/us/r30/Purple/v4/fc/4b/e3/fc4be397-6865-7011-361b-59f78c789e62/screen1136x1136.jpeg",
        "type": "screenshot",
        "device": "phone"
      },
      {
        "uri": "http://a5.mzstatic.com/us/r30/Purple/v4/f9/02/63/f902630c-3969-ab9f-07b4-2c91bd629fd0/screen1136x1136.jpeg",
        "type": "screenshot",
        "device": "phone"
      },
      {
        "uri": "http://a3.mzstatic.com/us/r30/Purple/v4/f8/21/0e/f8210e8f-a75a-33c0-9e86-e8c65c9faa54/screen1136x1136.jpeg",
        "type": "screenshot",
        "device": "phone"
      },
      {
        "uri": "http://is5.mzstatic.com/image/thumb/Purple/v4/ef/a0/f3/efa0f340-225e-e512-1616-8f223c6202ea/source/512x512bb.jpg",
        "type": "thumbnail"
      }
    ]
oshanley commented 8 years ago

For the width and height, do you want a width and height property on the image array, a string that would be something like '123x345', or a dimensions property that would have a width and height? Or something else?

howardengelhart commented 8 years ago

I guess dimensions works...

    "images": [
      {
        "uri": "http://a1.mzstatic.com/us/r30/Purple/v4/c2/ec/6b/c2ec6b9a-d47b-20e4-d1f7-2f42fffcb58f/screen1136x1136.jpeg",
        "type": "screenshot",
        "device": "phone",
        "size" : {
            "width" : 1300,
            "height" : 600
        }
      },