News for hackers. Stuff that matters.
Re:Firefox 66.0 Aims to Reduce Online Annoyances by wongarsu on Tuesday March 19, 2019 @11:51AM (#19431974)
If only there was a way to know the aspect ratio of an image at the time of website authoring...
Re:Firefox 66.0 Aims to Reduce Online Annoyances by ressetera on Tuesday March 19, 2019 @12:11PM (#19432184)
I personally dislike the complexity of having to use the server-side calculated dimensions.

``` object-fit: cover ```

comes to mind as a client-side solution I used in the past for this problem

Re:Firefox 66.0 Aims to Reduce Online Annoyances by dredmorbius on Tuesday March 19, 2019 @01:40PM (#19433282)
There are such things as dynamically sourced, or generated, images. On-the-fly-computed SVG data visualisations might be such a case.

Generally, I'd agree that authoring time is some 9X% solution, though there remain edge cases.

Re:Firefox 66.0 Aims to Reduce Online Annoyances by benj111 on Tuesday March 19, 2019 @02:12PM (#19433710)
You'd still want those at a fixed size though?

I can't think of a good use case for auto generating arbitrarily large images, and as a user I wouldn't want to visit websites where the web designer thinks that's a good idea either.

Re:Firefox 66.0 Aims to Reduce Online Annoyances by dredmorbius on Wednesday March 20, 2019 @01:49PM (#19444774)
Usually, yes, though posibly not in all cases. With SVG and CSS/JS, the size could be dynamic as the paage is being viewed, depending on user behaviour or other conditions

What thos cases are is ... a good question, and my point is more thaat this can be done than to say why or that it's a good idea.

Upshot again is that image size need not be deterministic at authoring time.

Re:Firefox 66.0 Aims to Reduce Online Annoyances by megous on Tuesday March 19, 2019 @04:28PM (#19435437)
Doesn't help if you try to do max-width: 100% in CSS. You'll get an image with a height you set in HTML and a smaller width.
Re:Firefox 66.0 Aims to Reduce Online Annoyances by phkahler on Tuesday March 19, 2019 @03:43PM (#19434880)
But wouldn't that require people to know what they're putting on their web site?