#does getImage accepts layout property?

7 messages · Page 1 of 1 (latest)

plush tulip
#

does getImage accepts layout property?

lunar sedgeBOT
#

Hi @plush tulip. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

The knowledge sources only document the layout property for the <Image /> and <Picture /> components from astro:assets, not for getImage(). [layout; responsive props]

I’m sorry, but there’s no information in the provided sources indicating that getImage() accepts a layout property.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:

#

@plush tulip Kapa.ai is still learning and improving, please let me know how I did by reacting below.

plush tulip
#

@lunar sedge does setting image property inside astro's config also affects the getImage ?

lunar sedgeBOT
#

Let me check the knowledge base for you again. One moment! :books:

#

Yes.

The image options you set in astro.config.mjs (i.e. AstroConfig["image"]) are the same configuration that getImage() uses:

  • The imageConfig helper is defined as AstroConfig["image"], “set by the user and merged with all defaults.” [imageConfig]
  • There is also a lower-level getImage() that explicitly takes both options and an imageConfig argument, which is that same config object. [imports from astro/assets]

So when you use the regular getImage() from astro:assets, it runs with the globally configured image settings (formats, layout defaults, etc.) unless you override behavior via its options.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: