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

Images as media types? #11

Closed
rykorp opened this issue Jul 21, 2012 · 6 comments
Closed

Images as media types? #11

rykorp opened this issue Jul 21, 2012 · 6 comments

Comments

@rykorp
Copy link

rykorp commented Jul 21, 2012

Looking over the API doc, could images be generalized as a media type which are then subcategorized based on MIME types? this would leave the door open for videos as well. If annotations could be attached to the media type, then we could create a pretty versatile bucket for dumping metadata (like EXIF). This could keep the core objects pretty small.

@DanFarfan
Copy link

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.

@berg
Copy link
Member

berg commented Jul 22, 2012

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?

@rykorp
Copy link
Author

rykorp commented Jul 24, 2012

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
}
}

@berg
Copy link
Member

berg commented Jul 24, 2012

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.

@jschlesser
Copy link

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.

@orianmarx
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants