-
Notifications
You must be signed in to change notification settings - Fork 561
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
Allow explicit image sizes #536
Comments
Keep in mind that it is technically already possible to achieve one's desired image size by setting an Image's size to "auto." However it's not possible to use a larger image and render it at a smaller size, unless that size is one of the 3 we support, and will therefore rarely be the one a card author needs. The proposed feature makes it way easier to do icons that will scale properly from 96dpi screens to high dpi screens. |
We should also consider what this means if we were to support Responsive layouts. I know it's still a "blue sky" idea, but it could be on our roadmap. |
I think it would actually help - knowing the desired size of an image before loading/rendering it makes it possible to make early layout decisions. |
Closing as dupe of #622 |
Closed as dupe of #622
Implementation
Problem
Our current image sizing is way too restrictive. We should allow explicit image sizing, allowing card authors to use a large image and render it at the desired size.
Solution
Introduce explicit image capability sizing in all renderers. Exposing this capability via markup can then be done via extensibility.
The HTML renderer will add the following two properties to the Image class:
The names are chosen so as to not interfere with the existing height property.
When either the pixelWidth or pixelHeight properties (or both) are set, the image is explicitly sized using these values. If only one of the two properties is is set, the other dimension is automatically calculated so that the original aspect ratio of the image is respected.
The text was updated successfully, but these errors were encountered: