observablehq / stdlib

The Observable standard library.
https://observablehq.com/@observablehq/standard-library
ISC License
961 stars 83 forks source link

Add options to FileAttachment(…).image() #231

Closed Fil closed 2 years ago

Fil commented 3 years ago

In https://github.com/observablehq/stdlib/blob/main/src/fileAttachment.js#L43 it would be interesting to add options such as:

A short-hand notation for "half-size" would also be useful (maybe {pixelRatio: 2}?) currently, when you upload a screenshot taken on a retina screen, you need to look up the image's width, then write a full <img src="….url()" width="W/2"> tag.

mootari commented 3 years ago

longdesc is deprecated and afaik not used anywhere. You probably meant title?

Fil commented 3 years ago

oops, correct! Now I refreshed my memory by reading https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img and it seems that intrisicsize could also be useful in some cases. And also styles.

CobusT commented 2 years ago

Also mentioned in the feedback repo: https://github.com/observablehq/feedback/issues/268