09:02 | <Max> | It would be very useful, I think, so have an API that returned the width of the image in the file that is downloaded, prior to browser interventions. |
09:17 | <zcorpan> | Max: the spec doesn't account for browser interventions for low memory devices. Maybe it could be argued that such interventions should not have observable effects on APIs such as naturalWidth |
09:23 | <zcorpan> | But since the intervention seems to be to make images smaller to not run out of memory, maybe there's no great option. The spec could allow it to happen and expose a new property to let the page know that it did (and how much it was scaled) |
09:25 | <Max> | yeah. I'm really just looking for the information provided in the dev tools - I forget exactly the wording, but the information is there, so I guess it's available somewhere. |
09:25 | <zcorpan> | Max: see https://bugs.chromium.org/p/chromium/issues/detail?id=1187043#c9 |
09:29 | <Max> | ah, dev tools says 'intrinsic size' and that remains the 'correct' size :) |
09:30 | <Max> | Max: see https://bugs.chromium.org/p/chromium/issues/detail?id=1187043#c9 |
09:30 | <Max> | I realise "there are ways"...just feel like it would be good to just expose the information since it's already there (assuming it is) |
09:31 | <Max> | I suppose I'm wondering how certain the 'AFAIK/CT' is in that message... |
09:32 | <zcorpan> | Max: I assume fs looked at the code |
09:33 | <Max> | ok, fair enough. I already 'worked around' my actual issue...just following it up to see if there's any chance of getting the raw data in an api...perhaps there are more importnat things. |
09:37 | <zcorpan> | changes are always possible. I don't know if an API for this is a good thing long-term. I've added a comment in the chromium issue |
09:41 | <Max> | ok, thanks for that. |
09:47 | <Max> | Note that I'm not concerned about the UA scaling the image down, just that I have the dimensions of the original... |
09:47 | <Max> | but anyway, I think I'm done with that. Thanks for your attention. |
09:50 | <zcorpan> | sure, but it could break other pages that don't know about this happening. trying to apply first principles, that interventions like this should be unobservable to the page if possible :) |
09:58 | <Luca Casonato> | annevk: Is there consensus that a proposal for adding base64 encoding to TextEncoder / TextDecoder would be rejected? If not I'd like to write up a proposal. |
09:59 | <Luca Casonato> | Only reference public issue somewhat related I could find is https://github.com/whatwg/encoding/issues/138 |
10:01 | <Luca Casonato> | I assume this has been discussed before and rejected because semantically using a TextEncoder to decode base64 is kinda strange. |
10:12 | <Andreu Botella (he/they)> | Luca Casonato: The encoding standard and the TextDecoder /Encoder APIs are for character encodings, not something like base64. |
10:13 | <Andreu Botella (he/they)> | Even isomorphic encoding, which is technically a character encoding (Latin-1) is not a good fit for the standard as per the bug you linked. |
10:14 | <Andreu Botella (he/they)> | But I guess some version of atob that works on buffers could be added to the HTML spec |
10:15 | <Luca Casonato> | Makes sense. Maybe a new BinaryEncoder / BinaryDecoder that can do base64 / hex? |
10:15 | <Andreu Botella (he/they)> | That might work |
11:16 | <sideshowbarker> | timothygu++ for https://chromium.googlesource.com/chromium/src/+/97d5f5cd25bf571c42ab167980873471389d0959 |
12:46 | <annevk> | Luca Casonato: there's variants of base64 (see also Infra) so that's something that needs solving too |
12:48 | <annevk> | Luca Casonato: apart from what Andreu Botella (he/they) said it also ends up being a mismatch with the terms; text encode is string -> bytes, but base64 encode is bytes -> string |
13:01 | <Luca Casonato> | Makes sense. I’ll write up a little doc on the problem |
19:12 | <Luca Casonato> | Started on a little proposal: https://github.com/lucacasonato/proposal-binary-encoding. Probably not great though - don't really know what the standard practice for new proposals is though. Are there some recent pre-standardization WHATWG proposals out there to look at? |