-
Notifications
You must be signed in to change notification settings - Fork 12
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
Natural image resolution, CSS. web compat, and pHYs
#97
Comments
HTML prepare an image for presentation refers only to EXIF
and has no mention of PNG |
So this is a bit less settled than I thought:
This means that we would be adding some caveat to the description of
which seems unlikely to age well. Having poked around some, my inclination is to defer this issue until the referenced specifications settle down, before adding anything to the PNG spec. |
Agreed. Let's update the tags and all that, pushing it to a later spec. |
Do we have tests for this chunk? And how often does it occur in the wild? If it's already fairly present, it might not be possible to change implementations. I'm not sure what kind of abstraction we want for a theoretical "Web images" specification, but ideally it could pass a byte sequence to some algorithm in the PNG specification and get a bitmap and metadata back. |
The old PNGsuite has four images that contain this chunk.
I have WPT-style tests with these images, which shows browsers ignore this chunk (which they are allowed to do, per HTML, CSS and PNG specs, currently). My original intent with this issue was to add a note to the PNG spec saying that browsers have historically ignored 'pHYs' and it does not affect display of the image. |
In that comment they display differently in Safari, but perhaps that's GitHub doing something to them? |
In firefox and in chrome they display as 32x8, 8x8, 32x32 and 8x32 ie their actual pixel widths and heights from 'IHDR'. The 'pHYs' makes no difference at all. |
I don't have data, except to observe that any chunk that goes beyond the bare minimum to display an image tends to get dropped by image optimizers, whose use is widespread to get the smallest images.
I agree that Web compat should be the main concern here, and the specifications should reflect that. 'pHYs' has been in the PNG spec since the first, 1996, edition |
Several comments back, I mentioned I would mark this for a future edition. Then I marked it for the current edition. I'm going to correct that. |
The fact that Web browsers either don't use
pHYs
or, if they do, apply it as a scaling factor not an absolute resolution should be noted in the definition of that chunk. A note could also be added to the documentation ofeXIf
For a good summary (in the context of CSS Images 3) see here
The text was updated successfully, but these errors were encountered: