gatsby-source-sanity icon indicating copy to clipboard operation
gatsby-source-sanity copied to clipboard

Add support for tracedSVG

Open selrond opened this issue 5 years ago • 11 comments
trafficstars

Is there any specific reason it's not supported right now? According to the gatsby-image docs, only these options are supported:

gatsby-source-sanity

  • GatsbySanityImageFixed
  • GatsbySanityImageFixed_noBase64
  • GatsbySanityImageFluid
  • GatsbySanityImageFluid_noBase64

selrond avatar Feb 12 '20 11:02 selrond

Since Sanity offers a full image transformation pipeline of its own, Gatsby doesn't need to download the images in order to generate multiple sizes. Since Gatsby doesn't have the image data, its unable to process the image into an SVG “trace” to serve up.

coreyward avatar Feb 26 '20 19:02 coreyward

@coreyward how about adding the ability to download & use downloaded images? It would especially help people that are on Sanity developer plan to not hit the CDN limits.

It's solvable with Schema customization or gatsby-plugin-remote-images.

selrond avatar Feb 28 '20 12:02 selrond

Sanity provides a pretty generous allotment of bandwidth and the charges for overages are fair. In any case, downloading the full size versions for local processing on every build would be quite a bit of bandwidth itself, plus it would slow your builds and you’d need to pay for the bandwidth they consume elsewhere. Six of one, half a dozen of another.

coreyward avatar Feb 28 '20 14:02 coreyward

@coreyward that should be up to the plugin users though shouldn't it? Besides, static file hosting is becoming so cheap and abundant that the "bandwidth" part of your argument is almost irrelevant.

selrond avatar Mar 02 '20 10:03 selrond

It would especially help people that are on Sanity developer plan to not hit the CDN limits.

… hosting is becoming so cheap and abundant that the "bandwidth" part of your argument is almost irrelevant.

🤔🤷‍♂️ I'm just trying to provide some context based on what you asked.

coreyward avatar Mar 02 '20 16:03 coreyward

@coreyward sure, and I'm just addressing it :) If there's not some secret policy in play, I think providing an option to download & use sanity images locally would be a good addition.

selrond avatar Mar 02 '20 17:03 selrond

There's also this: https://github.com/reactgraphqlacademy/gatsby-source-sanity-transform-images

coreyward avatar Mar 02 '20 22:03 coreyward

Hello maybe can you also support different kinds for loading images

MiguelAngelOne avatar Aug 01 '20 20:08 MiguelAngelOne

@rexxars would you be open to support local images?

selrond avatar Aug 07 '20 10:08 selrond

@rexxars would you be open to support local images?

I'm open to downloading pre-transformed images, but I'm skeptical about pulling down full-size images and transforming them on the client, since that will add sharp as a dependency and have a totally separate code path. Native modules are a bit of a pain and usually leads to a large number of platform-specific build issues and whatnot.

rexxars avatar Aug 10 '20 17:08 rexxars

@rexxars would you be open to support local images?

I'm open to downloading pre-transformed images, but I'm skeptical about pulling down full-size images and transforming them on the client, since that will add sharp as a dependency and have a totally separate code path. Native modules are a bit of a pain and usually leads to a large number of platform-specific build issues and whatnot.

Client === at build time here?

Also, that means that avif support is dependent on Sanity doing the transforms (and avif is expensive to create)?

Hahlh avatar May 30 '21 09:05 Hahlh