Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Image API #10

Closed
tisto opened this issue Apr 17, 2015 · 2 comments
Closed

Implement Image API #10

tisto opened this issue Apr 17, 2015 · 2 comments

Comments

@tisto
Copy link
Sponsor Member

tisto commented Apr 17, 2015

{
    contentType
    size
    data/download
    filename
    scale: {
        'mini': {
            href: ...
            width: 400,
            height: 200,
        }
    }
}
@tisto tisto added this to the 0.1 - Minimal read-only content API milestone Apr 17, 2015
@tisto tisto added the ready label May 12, 2015
@lukasgraf lukasgraf mentioned this issue May 24, 2016
3 tasks
@lukasgraf
Copy link
Member

Image fields currently get serialized as a mapping of scale_name: download_url (see docs).

I would propose the following serialization format instead:

{
  "@id": "http://nohost/plone/my-image",
  "@type": "Image",
  "title": "My Image",
  "...": "...",
  "image": {
    "filename": "image.png",
    "content-type": "image/png",
    "size": 1185,
    "download": "http://nohost/plone/my-image/@@images/image",
    "scales": {
      "icon": "http://nohost/plone/my-image/@@images/image/icon",
      "large": "http://nohost/plone/my-image/@@images/image/large",
      "listing": "http://nohost/plone/my-image/@@images/image/listing",
      "mini": "http://nohost/plone/my-image/@@images/image/mini",
      "original": "http://nohost/plone/my-image/@@images/image",
      "preview": "http://nohost/plone/my-image/@@images/image/preview",
      "thumb": "http://nohost/plone/my-image/@@images/image/thumb",
      "tile": "http://nohost/plone/my-image/@@images/image/tile"
    }
  }
}

This doesn't include the dimensions for each scale as in your initial suggestion, but including those would make the response really rather bulky. I don't feel strongly about this, but I probably wouldn't include those until we have framing in place and a client can request to have them omitted.

@tisto
Copy link
Sponsor Member Author

tisto commented May 29, 2016

Closed by #115

@tisto tisto closed this as completed May 29, 2016
@tisto tisto removed the ready label May 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants