{"record":{"id":"de177fb893a2ca82","repo":"gohugoio/hugo","slug":"invalid-metadata-source-q-in-imaging-meta-sources","errorCode":null,"errorMessage":"invalid metadata source %q in imaging.meta.sources config; must be one of %s","messagePattern":"invalid metadata source %q in imaging\\.meta\\.sources config; must be one of (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"resources/images/config.go","lineNumber":607,"sourceCode":"\tif len(cfg.Meta.Fields) == 0 {\n\t\t// Default: include all fields except technical metadata.\n\t\t// Don't change this for no good reason. Please don't.\n\t\tcfg.Meta.Fields = []string{\n\t\t\t\"! *{GPS,Exif,Exposure[MPB],Contrast,Resolution,Sharp,JPEG,Metering,Sensing,Saturation,ColorSpace,Flash,WhiteBalance}*\",\n\t\t}\n\t}\n\n\tif len(cfg.Meta.Sources) == 0 {\n\t\t// Default to EXIF and IPTC (XMP is slower to decode).\n\t\tcfg.Meta.Sources = []string{\"exif\", \"iptc\"}\n\t} else {\n\t\t// Normalize to lowercase.\n\t\tfor i, s := range cfg.Meta.Sources {\n\t\t\tcfg.Meta.Sources[i] = strings.ToLower(s)\n\t\t\tif !validMetaSources[cfg.Meta.Sources[i]] {\n\t\t\t\tkeys := slices.Collect(maps.Keys(validMetaSources))\n\t\t\t\tslices.Sort(keys)\n\t\t\t\treturn fmt.Errorf(\"invalid metadata source %q in imaging.meta.sources config; must be one of %s\", s, keys)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil\n}\n\ntype ExifConfig struct {\n\t// Regexp matching the Exif fields you want from the (massive) set of Exif info\n\t// available. As we cache this info to disk, this is for performance and\n\t// disk space reasons more than anything.\n\t// If you want it all, put \".*\" in this config setting.\n\t// Note that if neither this or ExcludeFields is set, Hugo will return a small\n\t// default set.\n\tIncludeFields string\n\n\t// Regexp matching the Exif fields you want to exclude. This may be easier to use\n\t// than IncludeFields above, depending on what you want.","sourceCodeStart":589,"sourceCodeEnd":625,"githubUrl":"https://github.com/gohugoio/hugo/blob/52c9bd7908b4d02d4d0ff8f82a888834d6ee10d2/resources/images/config.go#L589-L625","documentation":"Validates each entry in imaging.meta.sources after lowercasing. The only allowed values are 'exif', 'iptc', and 'xmp' (defined in the validMetaSources map). The error message lists all valid keys, sorted alphabetically. This controls which metadata standards Hugo extracts from images.","triggerScenarios":"Setting imaging.meta.sources in hugo.toml to a list containing any string other than exif, iptc, or xmp (case-insensitive, since values are normalized to lowercase before checking).","commonSituations":"Typing 'EXIF' in uppercase (harmless — normalized), 'tiff' or 'raw' (not supported), or 'rdf' (confusing XMP's underlying format with the source name). Also from copying an example that references a source removed or renamed in a newer Hugo version.","solutions":["Check the error message — it prints the invalid source and the sorted list of valid sources.","Fix imaging.meta.sources in hugo.toml to contain only values from {exif, iptc, xmp}.","Remove the sources key to use the default of ['exif', 'iptc'] (XMP is excluded by default for performance)."],"exampleFix":"# before (hugo.toml)\n[imaging.meta]\nsources = [\"exif\", \"iptc\", \"tiff\"]\n\n# after\n[imaging.meta]\nsources = [\"exif\", \"iptc\", \"xmp\"]","handlingStrategy":"validation","validationCode":"// Validate metadata sources before decoding\nfunc validateMetaSources(sources []string) error {\n    valid := map[string]bool{\"exif\": true, \"iptc\": true, \"xmp\": true}\n    for _, s := range sources {\n        if !valid[strings.ToLower(s)] {\n            return fmt.Errorf(\"invalid metadata source %q; valid: exif, iptc, xmp\", s)\n        }\n    }\n    return nil\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Stick to the default ['exif', 'iptc'] — XMP is slower and more prone to parsing issues.","Values are case-insensitive but lowercase is conventional.","Only add 'xmp' if your templates actually use XMP-derived metadata fields."],"tags":["hugo","imaging","metadata","config-validation"],"backgroundTag":null,"analyzedSha":"52c9bd7908b4d02d4d0ff8f82a888834d6ee10d2","analyzedAt":"2026-08-09T21:49:36.660Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}