Coder Social home page Coder Social logo

Implement Image API about plone.restapi HOT 2 CLOSED

plone avatar plone commented on June 19, 2024
Implement Image API

from plone.restapi.

Comments (2)

lukasgraf avatar lukasgraf commented on June 19, 2024

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.

from plone.restapi.

tisto avatar tisto commented on June 19, 2024

Closed by #115

from plone.restapi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.