{"id":"d394b6881d226625","repo":"gohugoio/hugo","slug":"imaging-webp-hint-must-be-one-of-picture-photo-d","errorCode":null,"errorMessage":"imaging.webp.hint must be one of picture, photo, drawing, icon, or text, got %q","messagePattern":"imaging\\.webp\\.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":782,"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 = 75\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.webp.hint must be one of picture, photo, drawing, icon, or text, got %q\", c.Hint)\n\t}\n\tif c.Method < 0 || c.Method > 6 {\n\t\treturn fmt.Errorf(\"imaging.webp.method must be between 0 and 6, got %d\", c.Method)\n\t}\n\tif c.Compression != \"\" && !compressionMethods[c.Compression] {\n\t\treturn fmt.Errorf(\"imaging.webp.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.webp.quality must be between 1 and 100 inclusive, got %d\", c.Quality)\n\t}\n\treturn nil\n}\n","sourceCodeStart":764,"sourceCodeEnd":795,"githubUrl":"https://github.com/gohugoio/hugo/blob/8a468df065a75c1c7cf9f6850f32148746590ea5/resources/images/config.go#L764-L795","documentation":"WebpConfig.init validates the WebP `hint` option, which tells the libwebp-style encoder what kind of content the image is so it can tune encoding. After lowercasing and falling back to the global `imaging.hint` and then the default (\"photo\"), the value must be in the hints set: picture, photo, drawing, icon, or text.","triggerScenarios":"Setting `[imaging.webp] hint` or the global `[imaging] hint` to any other string in site config. Fires at config load time, before builds.","commonSituations":"Typos (\"pictures\", \"foto\"), guessing values like \"default\", \"graphic\", or \"screenshot\", or copying cwebp's `-preset` names that don't map one-to-one (e.g. \"default\").","solutions":["Change the hint to one of: picture, photo, drawing, icon, text.","Remove the key to use the default \"photo\".","Check the global `imaging.hint` too — the webp block inherits it when its own hint is unset."],"exampleFix":"# before\n[imaging.webp]\nhint = \"graphic\"\n# after\n[imaging.webp]\nhint = \"drawing\"","handlingStrategy":"validation","validationCode":"valid := map[string]bool{\"picture\": true, \"photo\": true, \"drawing\": true, \"icon\": true, \"text\": true}\nif h := cfg.Imaging.WebP.Hint; h != \"\" && !valid[h] {\n    return fmt.Errorf(\"invalid webp hint %q\", h)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only use documented hint values: picture, photo, drawing, icon, text","Lowercase the value; don't guess synonyms like \"image\" or \"graphic\"","Check the Hugo imaging docs for your Hugo version before setting hints"],"tags":["hugo","config","imaging","webp"],"analyzedSha":"8a468df065a75c1c7cf9f6850f32148746590ea5","analyzedAt":"2026-07-31T21:23:07.045Z","schemaVersion":2}