{"id":"f4001f932f281910","repo":"gohugoio/hugo","slug":"imaging-avif-hint-must-be-one-of-picture-photo-d","errorCode":null,"errorMessage":"imaging.avif.hint must be one of picture, photo, drawing, icon, or text, got %q","messagePattern":"imaging\\.avif\\.hint must be one of picture, photo, drawing, icon, or text, got %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"resources/images/config.go","lineNumber":718,"sourceCode":"\t}\n\tif c.Quality == 0 {\n\t\tc.Quality = ic.Quality\n\t}\n\tif c.Hint == \"\" {\n\t\tc.Hint = defaultHint\n\t}\n\tif c.Compression == \"\" {\n\t\tc.Compression = defaultCompression\n\t}\n\tif c.Quality == 0 {\n\t\tc.Quality = 60\n\t}\n\n\tc.Hint = strings.ToLower(c.Hint)\n\tc.Compression = strings.ToLower(c.Compression)\n\n\tif c.Hint != \"\" && !hints[c.Hint] {\n\t\treturn fmt.Errorf(\"imaging.avif.hint must be one of picture, photo, drawing, icon, or text, got %q\", c.Hint)\n\t}\n\tif c.EncoderSpeed < 1 || c.EncoderSpeed > 10 {\n\t\treturn fmt.Errorf(\"imaging.avif.encoderSpeed must be between 1 and 10, got %d\", c.EncoderSpeed)\n\t}\n\n\tif c.Compression != \"\" && !compressionMethods[c.Compression] {\n\t\treturn fmt.Errorf(\"imaging.avif.compression must be one of lossy or lossless, got %q\", c.Compression)\n\t}\n\tif c.Quality < 1 || c.Quality > 100 {\n\t\treturn fmt.Errorf(\"imaging.avif.quality must be between 1 and 100 inclusive, got %d\", c.Quality)\n\t}\n\n\treturn nil\n}\n\n// WebpConfig holds WebP-specific encoding configuration.\ntype WebpConfig struct {\n\t// Quality setting (1-100). Falls back to the global imaging.quality if unset.","sourceCodeStart":700,"sourceCodeEnd":736,"githubUrl":"https://github.com/gohugoio/hugo/blob/8a468df065a75c1c7cf9f6850f32148746590ea5/resources/images/config.go#L700-L736","documentation":"AvifConfig.init validates the AVIF encoder hint, which controls chroma subsampling. The hint (explicit imaging.avif.hint, inherited from imaging.hint, or the default 'photo') is lowercased and checked against the fixed set picture/photo/drawing/icon/text.","triggerScenarios":"Setting imaging.avif.hint (or the global imaging.hint, which AVIF inherits) in site config to any value outside {picture, photo, drawing, icon, text} — e.g. 'image', 'graphic', 'screenshot'. Fires at config load.","commonSituations":"Guessing hint names from other encoders (cwebp uses different preset names like 'default'); typos ('phot'); using WebP preset values for the AVIF config.","solutions":["Change imaging.avif.hint to one of: picture, photo, drawing, icon, text.","Remove the setting to use the default of 'photo'.","If the invalid value comes from the global imaging.hint, fix it there since AVIF inherits it."],"exampleFix":"# before (hugo.toml)\n[imaging.avif]\nhint = \"graphic\"\n# after\n[imaging.avif]\nhint = \"drawing\"","handlingStrategy":"validation","validationCode":"switch cfg.Imaging.AVIF.Hint {\ncase \"\", \"picture\", \"photo\", \"drawing\", \"icon\", \"text\":\ndefault:\n    return fmt.Errorf(\"invalid imaging.avif.hint %q\", cfg.Imaging.AVIF.Hint)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only use the documented AVIF hint values: picture, photo, drawing, icon, text","Copy enum values from the Hugo docs rather than guessing from other encoders' vocab","Validate config in CI so an invalid hint fails fast before publish"],"tags":["hugo","config","avif","image-processing","validation"],"analyzedSha":"8a468df065a75c1c7cf9f6850f32148746590ea5","analyzedAt":"2026-07-31T21:23:07.045Z","schemaVersion":2}