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

Handle missing width and height attributes for images #14

Closed
2 of 3 tasks
mjangda opened this issue Sep 30, 2015 · 2 comments
Closed
2 of 3 tasks

Handle missing width and height attributes for images #14

mjangda opened this issue Sep 30, 2015 · 2 comments
Labels
Bug Something isn't working Validation
Milestone

Comments

@mjangda
Copy link
Contributor

mjangda commented Sep 30, 2015

Not all <img> tags have width/height attributes which are required for the matching <amp-img> tag. We should find a way to include that somehow.

  • If srcset or sizes are included, try to pull from them, if possible.
  • Pull from attachment metadata.
  • Fetch the remote image and calculate/save the size (getimagesize and wpcom's getimagesize).

Related #13

@mjangda mjangda added the Bug Something isn't working label Sep 30, 2015
@mjangda mjangda added this to the Developer Preview milestone Sep 30, 2015
@mjangda
Copy link
Contributor Author

mjangda commented Oct 1, 2015

This is partially handled. There are cases like hotlinked images that we need to figure out. Possible options:

  • live with the validation errors/potentially broken layouts
  • fetch the remote image and calculate the size
  • use something like Photon to get dimension data (Photon doesn't support this but we could add it)

The third one is only workable for wpcom and self-hosted sites with Jetpack.

@mjangda
Copy link
Contributor Author

mjangda commented Oct 6, 2015

We should set a max of 600 ($content_width if set, or fallback to 600) for images since that's the max size of our column.

@kraftbj kraftbj mentioned this issue Oct 8, 2015
@mjangda mjangda modified the milestones: Developer Preview, v1 Oct 30, 2015
@mjangda mjangda modified the milestones: v0.2, v0.3 Jan 28, 2016
@mjangda mjangda mentioned this issue Feb 17, 2016
5 tasks
@mjangda mjangda closed this as completed Feb 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Validation
Projects
None yet
Development

No branches or pull requests

2 participants