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

Spike: Images #10

Open
petrsvihlik opened this issue Jun 19, 2017 · 2 comments
Open

Spike: Images #10

petrsvihlik opened this issue Jun 19, 2017 · 2 comments

Comments

@petrsvihlik
Copy link
Contributor

  1. Would it be possible to somehow generate width and height for images automatically?
  2. Could we somehow leverage image variants?
@kentico-timothyf
Copy link
Contributor

I don't think image variants is the right fit for this. In the output filter we are already scanning for images and applying the amp-img tag, maybe we could check here if the width and height is set and if not get the image and find the width and height and insert them into the amp-img tag. Since we are doing it server-side it would still elminate the need for the client to download the image to get the aspect ratio for amp and amp cache should make this call only happen once per (cache expiration) right? what do you think?

@petrsvihlik
Copy link
Contributor Author

So what you are suggesting is that we parse the image URL, figure out whether the image is an attachment, cms.file, media file, or whathever else and then call a respective method through the API to get the dimensions?

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