#getImage result

2 messages · Page 1 of 1 (latest)

placid lake
#

I have a local img in the project in the src/assets, I had the image like so:

          <Image
            src={SomeImage}
            alt="Some alt"
            priority
            widths={[1000]}
          />

and the generate bundle for the image was 32kb, but then because I need to use it twice, and one of them as a bg image around the original one I exported it to
await getImage({ src: SomeImage, widths: [1000] })

and use it on both places like:

          <Image
            {...someImage}
            width={someImage.attributes.width}
            height={someImage.attributes.height}
            alt="Some alt"
            priority
          />

but the image loaded now is 46kb, and even when I change the widths array it still generates one, the higher one, why is that?

solemn glenBOT
#

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