Skip to content

Commit

Permalink
use correct default
Browse files Browse the repository at this point in the history
  • Loading branch information
LekoArts committed Aug 8, 2022
1 parent 762172f commit 3eff34d
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion packages/gatsby-plugin-sharp/README.md
Expand Up @@ -52,7 +52,7 @@ plugins: [
- `defaults`: default values used for `gatsbyImageData` and `StaticImage` from [gatsby-plugin-image](https://www.gatsbyjs.com/plugins/gatsby-plugin-image).
Available options are: `formats`,`placeholder`,`quality`,`breakpoints`,`backgroundColor`,`tracedSVGOptions`,`blurredOptions`,`jpgOptions`,`pngOptions`,`webpOptions`,`avifOptions`.
For details of these, see [the reference guide](https://www.gatsbyjs.com/docs/reference/built-in-components/gatsby-plugin-image).
- `failOn`: default = `error`. By default builds will fail if there is a corrupted image. Set to `none` to continue the build on error. The image will return `undefined`. You can customize this option, see [`options.failOn`](https://sharp.pixelplumbing.com/api-constructor#parameters).
- `failOn`: default = `warning`. By default builds will fail if there is a corrupted image. Set to `none` to continue the build on error. The image will return `undefined`. You can customize this option, see [`options.failOn`](https://sharp.pixelplumbing.com/api-constructor#parameters).

Other options are deprecated, and should only be used for the legacy `fixed` and `fluid` functions.

Expand Down
Expand Up @@ -85,7 +85,7 @@ exports[`gatsby-plugin-sharp fixed correctly infers the width when only the heig
"pluginOptions": Object {
"base64Width": 20,
"defaultQuality": 50,
"failOn": "error",
"failOn": "warning",
"forceBase64Format": "",
"lazyImageGeneration": true,
"stripMetadata": true,
Expand Down Expand Up @@ -142,7 +142,7 @@ exports[`gatsby-plugin-sharp fixed does not warn when the requested width is equ
"pluginOptions": Object {
"base64Width": 20,
"defaultQuality": 50,
"failOn": "error",
"failOn": "warning",
"forceBase64Format": "",
"lazyImageGeneration": true,
"stripMetadata": true,
Expand Down Expand Up @@ -185,7 +185,7 @@ exports[`gatsby-plugin-sharp fixed warns when the requested width is greater tha
"pluginOptions": Object {
"base64Width": 20,
"defaultQuality": 50,
"failOn": "error",
"failOn": "warning",
"forceBase64Format": "",
"lazyImageGeneration": true,
"stripMetadata": true,
Expand Down Expand Up @@ -256,7 +256,7 @@ exports[`gatsby-plugin-sharp fluid accepts srcSet breakpoints 1`] = `
"pluginOptions": Object {
"base64Width": 20,
"defaultQuality": 50,
"failOn": "error",
"failOn": "warning",
"forceBase64Format": "",
"lazyImageGeneration": true,
"stripMetadata": true,
Expand Down Expand Up @@ -299,7 +299,7 @@ exports[`gatsby-plugin-sharp fluid adds pathPrefix if defined 1`] = `
"pluginOptions": Object {
"base64Width": 20,
"defaultQuality": 50,
"failOn": "error",
"failOn": "warning",
"forceBase64Format": "",
"lazyImageGeneration": true,
"stripMetadata": true,
Expand Down Expand Up @@ -382,7 +382,7 @@ Array [
"pluginOptions": Object {
"base64Width": 20,
"defaultQuality": 50,
"failOn": "error",
"failOn": "warning",
"forceBase64Format": "",
"lazyImageGeneration": true,
"stripMetadata": true,
Expand Down Expand Up @@ -464,7 +464,7 @@ Array [
"pluginOptions": Object {
"base64Width": 20,
"defaultQuality": 50,
"failOn": "error",
"failOn": "warning",
"forceBase64Format": "",
"lazyImageGeneration": true,
"stripMetadata": true,
Expand Down Expand Up @@ -546,7 +546,7 @@ Array [
"pluginOptions": Object {
"base64Width": 20,
"defaultQuality": 50,
"failOn": "error",
"failOn": "warning",
"forceBase64Format": "",
"lazyImageGeneration": true,
"stripMetadata": true,
Expand Down Expand Up @@ -628,7 +628,7 @@ Array [
"pluginOptions": Object {
"base64Width": 20,
"defaultQuality": 50,
"failOn": "error",
"failOn": "warning",
"forceBase64Format": "",
"lazyImageGeneration": true,
"stripMetadata": true,
Expand Down Expand Up @@ -688,7 +688,7 @@ Array [
"pluginOptions": Object {
"base64Width": 20,
"defaultQuality": 50,
"failOn": "error",
"failOn": "warning",
"forceBase64Format": "",
"lazyImageGeneration": true,
"stripMetadata": true,
Expand Down Expand Up @@ -752,7 +752,7 @@ Array [
"pluginOptions": Object {
"base64Width": 20,
"defaultQuality": 50,
"failOn": "error",
"failOn": "warning",
"forceBase64Format": "",
"lazyImageGeneration": true,
"stripMetadata": true,
Expand Down Expand Up @@ -816,7 +816,7 @@ Array [
"pluginOptions": Object {
"base64Width": 20,
"defaultQuality": 50,
"failOn": "error",
"failOn": "warning",
"forceBase64Format": "",
"lazyImageGeneration": true,
"stripMetadata": true,
Expand Down Expand Up @@ -880,7 +880,7 @@ Array [
"pluginOptions": Object {
"base64Width": 20,
"defaultQuality": 50,
"failOn": "error",
"failOn": "warning",
"forceBase64Format": "",
"lazyImageGeneration": true,
"stripMetadata": true,
Expand Down Expand Up @@ -916,7 +916,7 @@ exports[`gatsby-plugin-sharp fluid does not change the arguments object it is gi
"pluginOptions": Object {
"base64Width": 20,
"defaultQuality": 50,
"failOn": "error",
"failOn": "warning",
"forceBase64Format": "",
"lazyImageGeneration": true,
"stripMetadata": true,
Expand Down Expand Up @@ -987,7 +987,7 @@ exports[`gatsby-plugin-sharp fluid ensure maxWidth is in srcSet breakpoints 1`]
"pluginOptions": Object {
"base64Width": 20,
"defaultQuality": 50,
"failOn": "error",
"failOn": "warning",
"forceBase64Format": "",
"lazyImageGeneration": true,
"stripMetadata": true,
Expand Down Expand Up @@ -1082,7 +1082,7 @@ exports[`gatsby-plugin-sharp fluid infers the maxWidth if only maxHeight is give
"pluginOptions": Object {
"base64Width": 20,
"defaultQuality": 50,
"failOn": "error",
"failOn": "warning",
"forceBase64Format": "",
"lazyImageGeneration": true,
"stripMetadata": true,
Expand Down Expand Up @@ -1125,7 +1125,7 @@ exports[`gatsby-plugin-sharp fluid keeps original file name 1`] = `
"pluginOptions": Object {
"base64Width": 20,
"defaultQuality": 50,
"failOn": "error",
"failOn": "warning",
"forceBase64Format": "",
"lazyImageGeneration": true,
"stripMetadata": true,
Expand Down Expand Up @@ -1189,7 +1189,7 @@ exports[`gatsby-plugin-sharp fluid prevents duplicate breakpoints 1`] = `
"pluginOptions": Object {
"base64Width": 20,
"defaultQuality": 50,
"failOn": "error",
"failOn": "warning",
"forceBase64Format": "",
"lazyImageGeneration": true,
"stripMetadata": true,
Expand Down Expand Up @@ -1260,7 +1260,7 @@ exports[`gatsby-plugin-sharp fluid reject any breakpoints larger than the origin
"pluginOptions": Object {
"base64Width": 20,
"defaultQuality": 50,
"failOn": "error",
"failOn": "warning",
"forceBase64Format": "",
"lazyImageGeneration": true,
"stripMetadata": true,
Expand Down Expand Up @@ -1318,7 +1318,7 @@ exports[`gatsby-plugin-sharp queueImageResizing file name works with spaces & sp
"pluginOptions": Object {
"base64Width": 20,
"defaultQuality": 50,
"failOn": "error",
"failOn": "warning",
"forceBase64Format": "",
"lazyImageGeneration": true,
"stripMetadata": true,
Expand Down Expand Up @@ -1361,7 +1361,7 @@ exports[`gatsby-plugin-sharp queueImageResizing should round height when auto-ca
"pluginOptions": Object {
"base64Width": 20,
"defaultQuality": 50,
"failOn": "error",
"failOn": "warning",
"forceBase64Format": "",
"lazyImageGeneration": true,
"stripMetadata": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby-plugin-sharp/src/gatsby-node.js
Expand Up @@ -235,7 +235,7 @@ exports.pluginOptionsSchema = ({ Joi }) =>
failOnError: Joi.boolean().default(true),
failOn: Joi.any()
.valid(`none`, `truncated`, `error`, `warning`)
.default(`error`)
.default(`warning`)
.description(`Level of sensitivity to invalid images`),
defaults: Joi.object({
formats: Joi.array().items(
Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby-plugin-sharp/src/plugin-options.ts
Expand Up @@ -72,7 +72,7 @@ const pluginDefaults = {
stripMetadata: true,
lazyImageGeneration: true,
defaultQuality: 50,
failOn: `error` as FailOnOptions,
failOn: `warning` as FailOnOptions,
}

const generalArgs: Partial<IGeneralArgs> = {
Expand Down

0 comments on commit 3eff34d

Please sign in to comment.