Skip to content

Files

Latest commit

25207a6 · Dec 10, 2017

History

History
This branch is 18445 commits behind gatsbyjs/gatsby:master.

gatsby-transformer-sharp

gatsby-transformer-sharp

Creates ImageSharp nodes from image types that are supported by the Sharp image processing library and provides fields in their GraphQL types for processing your images in a variety of ways including resizing, cropping, and creating responsive images.

Live demo (source)

Install

npm install --save gatsby-transformer-sharp

How to use

// In your gatsby-config.js
plugins: [`gatsby-transformer-sharp`];

Parsing algorithm

It recognizes files with the following extensions as images.

  • jpeg
  • jpg
  • png
  • webp
  • tif
  • tiff

Each image file is parsed into a node of type ImageSharp.