-
Notifications
You must be signed in to change notification settings - Fork 683
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
[css-images] Images on the web #5173
Comments
@tabatkins @fantasai @LeaVerou thoughts? whatwg/html#5574 wants to standardize more EXIF data. As pointed out above we need a shared strategy for metadata and opaque responses. It would probably be good to make some progress here on these issues to make the fundamentals a bit clearer to implementers, especially now that it's still somewhat early days for taking EXIF data into account. cc @noamr |
cc @heycam |
And as more embedded metadata values will become important to browsers, I would agree that a single place to address the situation would be a good thing. |
👋 We've walked right into this one - I thought we'd fully implemented css-images-3 but, having found whatwg/html#5574 and the corresponding testcases I can see that's the wrong thing to do if we want to match browser implementations. As specified in css-images: the image-resolution (theoretically from the What actually happens is the image resolution defaults to the natural resolution of the image, but only if its specified by a particular combination of EXIF tags rather than the tags designed for this purpose in the JPEG and PNG specs (for compat reasons - having read the full PR above I understand why, but this isn't even hinted at in css-images-3 and it's far from obvious). If loaded from It's quite different. Particular issues:
I write this in the hope an anatomy of our failure can improve things, but the short version is:
|
HTML sizing rules have always applied to CSS - e.g. determining the default tile size in backgrounds. I am surprised though that there is no explicit link from CSS natural sizing definition to HTML natural sizing definition. Not sure if I'll have time to propose a PR for this myself :(
Why can they not apply to PNG? |
Fair point on EXIF in XMP - good to know that's the intention, thanks for letting me know. I agree a backlink from css-images natural sizing to HTML natural sizing would help significantly, given that's where the algorithm is specified. SVG2 auto-sizing of images links to css-images so no changes required there. |
True. PNG also has an |
Those are both the same link. |
Oops, wrong paste, I meant https://html.spec.whatwg.org/multipage/images.html#density-corrected-intrinsic-width-and-height But seems like the HTML spec has a reference to setting the CSS natural image dimensions here: https://html.spec.whatwg.org/multipage/images.html#prepare-an-image-for-presentation Would be good to have a back reference from CSS somehow. |
Yup, would definitely be good, I'll see what I can do. Reason it's lacking currently is the CSS text was written before the HTML stuff was, and I haven't realized I needed to go back and do more edits. |
(And this thread, in general, slipped into my "pandemic made me bad at tracking literally anything" backlog pile, sorry.) |
If this is not in same topic of the thread, I apologize, the topic seems to be for discussing issues between both html and css defining images, and those processes / specs. |
I think it's problematic that both CSS and HTML attempt to define images for the web.
We need a central place that is responsible for fetching and decoding a byte sequence/stream (and dealing with EXIF) into an abstract representation of an image, that can then be used for various purposes. If we define this in different places in conflicting ways, the differences can lead to security issues. (Perhaps some of these concerns can be split, but an image being generated from an opaque response is an important property that needs to be part of the model and thought through whenever new features are added.)
See also #4929 and #5165.
cc @domenic
The text was updated successfully, but these errors were encountered: