{"record":{"id":"157b58f93c7bda80","repo":"gatsbyjs/gatsby","slug":"pluginname-specifying-both-jpg-and-png-fo","errorCode":null,"errorMessage":"[${pluginName}] Specifying both 'jpg' and 'png' formats is not supported. Using 'auto' instead","messagePattern":"\\[(.+?)\\] Specifying both 'jpg' and 'png' formats is not supported\\. Using 'auto' instead","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/gatsby-plugin-image/src/image-utils.ts","lineNumber":268,"sourceCode":"    sourceMetadata = {\n      width,\n      height,\n      format: sourceMetadata?.format || formatFromFilename(filename) || `auto`,\n    }\n  } else if (!sourceMetadata.format) {\n    sourceMetadata.format = formatFromFilename(filename)\n  }\n\n  const formats = new Set<ImageFormat>(args.formats)\n\n  if (formats.size === 0 || formats.has(`auto`) || formats.has(``)) {\n    formats.delete(`auto`)\n    formats.delete(``)\n    formats.add(sourceMetadata.format)\n  }\n\n  if (formats.has(`jpg`) && formats.has(`png`)) {\n    reporter.warn(\n      `[${pluginName}] Specifying both 'jpg' and 'png' formats is not supported. Using 'auto' instead`\n    )\n    if (sourceMetadata.format === `jpg`) {\n      formats.delete(`png`)\n    } else {\n      formats.delete(`jpg`)\n    }\n  }\n\n  const imageSizes = calculateImageSizes({ ...args, sourceMetadata })\n\n  const result: IGatsbyImageData[\"images\"] = {\n    sources: [],\n  }\n\n  let sizes = args.sizes\n  if (!sizes) {\n    sizes = getSizes(imageSizes.presentationWidth, layout)","sourceCodeStart":250,"sourceCodeEnd":286,"githubUrl":"https://github.com/gatsbyjs/gatsby/blob/e85d62f1779e353eaac1753211629a26d123e26c/packages/gatsby-plugin-image/src/image-utils.ts#L250-L286","documentation":"Option-validation warning inside generateImageData: the `formats` array contains both `jpg` and `png`, which the pipeline cannot generate jointly. The set is not changed here (unlike gatsby-plugin-sharp's version), so behavior falls back toward 'auto' handling downstream; the warning names the offending plugin via pluginName.","triggerScenarios":"Thrown at packages/gatsby-plugin-image/src/image-utils.ts:268 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Specify only one of jpg or png, or omit formats / use \"auto\""],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e85d62f1779e353eaac1753211629a26d123e26c","analyzedAt":"2026-08-26T17:50:09.662Z","contentChangedAt":"2026-08-26T17:50:09.662Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}