How to use @sanity/imagetool - 2 common examples

To help you get started, we’ve selected a few @sanity/imagetool examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sanity-io / sanity / packages / @sanity / form-builder / src / inputs / ImageInput / ImageInput.tsx View on Github external
getConstrainedImageSrc = (assetDocument: Record): string => {
    const materializedSize = ImageTool.maxWidth || 1000
    const maxSize = materializedSize * getDevicePixelRatio()
    const constrainedSrc = `${assetDocument.url}?w=${maxSize}&h=${maxSize}&fit=max`
    return constrainedSrc
  }
github sanity-io / sanity / packages / @sanity / form-builder / src / inputs / ImageInput / ImageInput.tsx View on Github external
getConstrainedImageSrc = (assetDocument: Record): string => {
    const materializedSize = ImageTool.maxWidth || 1000
    const maxSize = materializedSize * getDevicePixelRatio()
    const constrainedSrc = `${assetDocument.url}?w=${maxSize}&h=${maxSize}&fit=max`
    return constrainedSrc
  }

@sanity/imagetool

The image hotspot selector / cropper used in Sanity

MIT
Latest version published 2 years ago

Package Health Score

75 / 100
Full package analysis

Popular @sanity/imagetool functions