{"id":"d549dbedb147e497","repo":"gohugoio/hugo","slug":"q-is-not-a-valid-resample-filter","errorCode":null,"errorMessage":"%q is not a valid resample filter","messagePattern":"%q is not a valid resample filter","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"resources/images/config.go","lineNumber":229,"sourceCode":"\t\t\treturn i, nil, err\n\t\t}\n\n\t\ti.BgColor, err = hexStringToColorGo(i.Imaging.BgColor)\n\t\tif err != nil {\n\t\t\treturn i, nil, err\n\t\t}\n\n\t\tif i.Imaging.Anchor != \"\" {\n\t\t\tanchor, found := anchorPositions[i.Imaging.Anchor]\n\t\t\tif !found {\n\t\t\t\treturn i, nil, fmt.Errorf(\"invalid anchor value %q in imaging config\", i.Imaging.Anchor)\n\t\t\t}\n\t\t\ti.Anchor = anchor\n\t\t}\n\n\t\tfilter, found := imageFilters[i.Imaging.ResampleFilter]\n\t\tif !found {\n\t\t\treturn i, nil, fmt.Errorf(\"%q is not a valid resample filter\", filter)\n\t\t}\n\n\t\ti.ResampleFilter = filter\n\n\t\treturn i, i.Imaging, nil\n\t}\n\n\tns, err := config.DecodeNamespace[ImagingConfig](in, buildConfig)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn ns, nil\n}\n\nfunc DecodeImageConfig(options []string, defaults *config.ConfigNamespace[ImagingConfig, ImagingConfigInternal], sourceFormat Format) (ImageConfig, error) {\n\tvar (\n\t\tc   ImageConfig = newImageConfig()\n\t\terr error","sourceCodeStart":211,"sourceCodeEnd":247,"githubUrl":"https://github.com/gohugoio/hugo/blob/8a468df065a75c1c7cf9f6850f32148746590ea5/resources/images/config.go#L211-L247","documentation":"The `resampleFilter` in the `[imaging]` config selects the resampling kernel (box, lanczos, catmullrom, mitchellnetravali, linear, nearestneighbor, gaussian, etc.) via the imageFilters map; an unknown name fails config decode. Note a quirk in the source: the error prints the zero-value `filter` variable rather than the configured string, so the message may show `\"\"` or an unhelpful value instead of what you typed (resources/images/config.go:229).","triggerScenarios":"`[imaging]\\nresampleFilter = \"bicubic\"` or any name absent from imageFilters; also an explicitly empty string, since only the absent key gets the default (box).","commonSituations":"Using filter names from other tools (ImageMagick's `bicubic`, `triangle` spellings); typos like `lanczos3`; setting the key to an empty string via templated config.","solutions":["Use a supported filter name such as `box`, `lanczos`, `catmullrom`, `mitchellnetravali`, `linear`, `nearestneighbor`, or `gaussian`.","Delete the resampleFilter key to fall back to the default (box).","If the message shows an empty/odd value, check your actual config string — the error text prints the wrong variable, so trust your config file, not the quoted value."],"exampleFix":"# before\n[imaging]\nresampleFilter = \"bicubic\"\n\n# after\n[imaging]\nresampleFilter = \"catmullrom\"","handlingStrategy":"validation","validationCode":"valid := map[string]bool{\"box\": true, \"lanczos\": true, \"catmullrom\": true, \"mitchellnetravali\": true, \"linear\": true, \"nearestneighbor\": true, \"gaussian\": true, \"hermite\": true, \"bspline\": true, \"hann\": true, \"hamming\": true, \"blackman\": true, \"bartlett\": true, \"welch\": true, \"cosine\": true}\nif !valid[strings.ToLower(filter)] { /* fix imaging.resampleFilter */ }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use a documented resample filter name (Box, Lanczos, CatmullRom, MitchellNetravali, Linear, NearestNeighbor, Gaussian, ...) in imaging.resampleFilter or resize specs like `\"600x400 Lanczos\"`","Names are case-insensitive but must match exactly otherwise — no abbreviations","Verify per-image filter arguments in templates against the same list"],"tags":["hugo","images","imaging","config","resampling"],"analyzedSha":"8a468df065a75c1c7cf9f6850f32148746590ea5","analyzedAt":"2026-07-31T21:23:07.045Z","schemaVersion":2}