{"record":{"id":"f9757ea8e15fde99","repo":"opendataloader-project/opendataloader-pdf","slug":"unsupported-image-output-mode-s-supported-valu","errorCode":null,"errorMessage":"Unsupported image output mode '%s'. Supported values: %s","messagePattern":"Unsupported image output mode '(.+?)'\\. Supported values: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"java/opendataloader-pdf-core/src/main/java/org/opendataloader/pdf/api/Config.java","lineNumber":585,"sourceCode":"\n    /**\n     * Gets the image output mode.\n     *\n     * @return The image output mode (off, embedded, or external).\n     */\n    public String getImageOutput() {\n        return imageOutput;\n    }\n\n    /**\n     * Sets the image output mode.\n     *\n     * @param imageOutput The image output mode (off, embedded, or external).\n     * @throws IllegalArgumentException if the mode is not supported.\n     */\n    public void setImageOutput(String imageOutput) {\n        if (imageOutput != null && !isValidImageOutput(imageOutput)) {\n            throw new IllegalArgumentException(\n                String.format(\"Unsupported image output mode '%s'. Supported values: %s\",\n                    imageOutput, getImageOutputOptions(\", \")));\n        }\n        this.imageOutput = imageOutput != null ? imageOutput.toLowerCase(Locale.ROOT) : IMAGE_OUTPUT_EXTERNAL;\n    }\n\n    /**\n     * Gets the list of supported image output options.\n     *\n     * @param delimiter The delimiter to use between options.\n     * @return The string with image output modes separated by the delimiter.\n     */\n    public static String getImageOutputOptions(CharSequence delimiter) {\n        return String.join(delimiter, imageOutputOptions);\n    }\n\n    /**\n     * Checks if the given image output mode is valid.","sourceCodeStart":567,"sourceCodeEnd":603,"githubUrl":"https://github.com/opendataloader-project/opendataloader-pdf/blob/a7789b8e77dd05e2b8659eb3ea12fc458f80bfb8/java/opendataloader-pdf-core/src/main/java/org/opendataloader/pdf/api/Config.java#L567-L603","documentation":"Config.setImageOutput rejects any value not in {off, embedded, external}. The check is case-insensitive (lowercased) but does not trim whitespace. null is accepted and defaults to external. IllegalArgumentException is thrown before assignment. Note: when reached via the CLI, the CLI layer (error [19]) pre-validates and throws the same message first, so this Config-level path effectively only fires for programmatic API callers.","triggerScenarios":"Direct API call config.setImageOutput(\"base64\") or config.setImageOutput(\" file\"); any unknown mode or untrimmed value.","commonSituations":"Using a value name from another tool (e.g. \"base64\" or \"inline\" instead of \"embedded\"); typo; whitespace from templated config.","solutions":["Use one of the supported values: off, embedded, or external.","Trim and lowercase values from external sources before passing.","Pre-validate with Config.isValidImageOutput(value)."],"exampleFix":"// before: config.setImageOutput(\"base64\");\n// after:  config.setImageOutput(\"embedded\");","handlingStrategy":"validation","validationCode":"String mode = externalValue == null ? null : externalValue.trim().toLowerCase(Locale.ROOT);\nif (mode != null && !Config.isValidImageOutput(mode)) {\n    throw new IllegalArgumentException(\n        \"Bad --image-output '\" + mode + \"'. Valid: \" + Config.getImageOutputOptions(\", \"));\n}\nconfig.setImageOutput(mode);","typeGuard":"static boolean isSupportedImageOutput(String s) {\n    return s != null && Config.isValidImageOutput(s.trim());\n}","tryCatchPattern":"try {\n    config.setImageOutput(raw);\n} catch (IllegalArgumentException e) {\n    config.setImageOutput(null); // default external\n}","preventionTips":["Map common synonyms (base64->embedded, file->external) before assigning.","Validate with Config.isValidImageOutput to keep the error out of the library."],"tags":["configuration","validation","image-output"],"backgroundTag":null,"analyzedSha":"a7789b8e77dd05e2b8659eb3ea12fc458f80bfb8","analyzedAt":"2026-08-14T05:22:03.953Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}