Giter Site home page Giter Site logo

Images as media types? about api-spec HOT 6 CLOSED

appdotnet avatar appdotnet commented on June 26, 2024
Images as media types?

from api-spec.

Comments (6)

DanFarfan avatar DanFarfan commented on June 26, 2024

I'm new here. I don't see a way to "vote up" honging's comment.
I agree completely. Came here to open the same issue.

from api-spec.

berg avatar berg commented on June 26, 2024

I'm not quite sure I fully understand, so could you help me understand how this might be different than an attachment annotation that would allow you to include metadata?

from api-spec.

 avatar commented on June 26, 2024

Referencing https://github.com/appdotnet/api-spec/blob/master/objects.md makes note of an "image" type (or is an image simply a subset of an attachment type? this doesn't seem to be clarified in the spec).

Instead of having an image:
{
"height": 512,
"width": 512,
"url": "https://example.com/image.jpg"
}

Once could generalize it further by not assuming the attachment is an image, but a generalized media type:

{
"mimetype": "image/x-png",
"height": 512,
"width": 512,
"url": "https://example.com/image.jpg"
}

Which would let you embed videos as well:
{
"height": 512,
"width": 512,
"duration": 60,
"mimetype": "video/mp4",
"url": "https://example.com/video.mp4"
}

or who knows?
{
"mimetype": "image/svg+xml",
"url": "https://example.com/maybe-svg-will-take-off-one-day.svg"
}

Expanding on this, an image might look like:

{
"height": 512,
"width": 512,
"mimetype": "image/x-jpg",
"url": "https://example.com/image.jpg".
"annotations": {
"exif:ImageWidth": 512
}
}

from api-spec.

berg avatar berg commented on June 26, 2024

Image is specifically for user icon and cover image. It's not the full and proper image annotation that we'll be adding (working on a draft of that as we speak.), more of a standard user schema for being able to have clients render posts from a user.

from api-spec.

jschlesser avatar jschlesser commented on June 26, 2024

It would be nice to have resolution info and maybe size (kb) info in the image objects as well. This might complicate media vs simple image but I think it will be necessary given screen and connectivity diversity.

from api-spec.

orianmarx avatar orianmarx commented on June 26, 2024

We're using an oembed annotation for this purpose: https://github.com/appdotnet/object-metadata/blob/master/annotations/net.app.core.oembed.md

from api-spec.

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.