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

Add functionality to Media objects to leverage Contentful image APIs #32

Open
sdedios opened this issue May 8, 2020 · 0 comments
Open
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@sdedios
Copy link
Member

sdedios commented May 8, 2020

Currently the Media objects used to represent assets from Contentful are plain Javascript objects without any functionality, however for certain media types (e.g. images) there exist rich Contentful APIs that provide transforms on the underlying image before serving it up to the client.

I would like to propose changing the Media interface / type to a class hierarchy that has additional functions which would support the broader image API features, such as:

  • Progressive JPEG
  • Image resizing
  • Image cropping
  • etc.

This change would not break compatibility assuming we had a base interface for Media that still looks the same, but then had classes for specific media types such as ImageMedia that then implemented the interface. You could also just have a base class Media that was subclassed - these are minor implementation details.

@sdedios sdedios added enhancement New feature or request good first issue Good for newcomers labels May 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant