{"record":{"id":"2740791f60933206","repo":"opendataloader-project/opendataloader-pdf","slug":"unsupported-image-output-mode-s-supported-valu-274079","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/cli/CLIOptions.java","lineNumber":458,"sourceCode":"        int applied = config.getThreads();\n        if (applied < requested) {\n            System.err.println(String.format(\n                    \"Warning: --threads=%d exceeds available CPU cores; capped to %d.\",\n                    requested, applied));\n        }\n    }\n\n    private static void applyImageOptions(Config config, CommandLine commandLine) {\n        if (commandLine.hasOption(IMAGE_OUTPUT_LONG_OPTION)) {\n            String outputValue = commandLine.getOptionValue(IMAGE_OUTPUT_LONG_OPTION);\n            if (outputValue == null || outputValue.trim().isEmpty()) {\n                throw new IllegalArgumentException(\n                        String.format(\"Option --image-output requires a value. Supported values: %s\",\n                                Config.getImageOutputOptions(\", \")));\n            }\n            String output = outputValue.trim().toLowerCase(Locale.ROOT);\n            if (!Config.isValidImageOutput(output)) {\n                throw new IllegalArgumentException(\n                        String.format(\"Unsupported image output mode '%s'. Supported values: %s\",\n                                output, Config.getImageOutputOptions(\", \")));\n            }\n            config.setImageOutput(output);\n        }\n        if (commandLine.hasOption(IMAGE_FORMAT_LONG_OPTION)) {\n            String formatValue = commandLine.getOptionValue(IMAGE_FORMAT_LONG_OPTION);\n            if (formatValue == null || formatValue.trim().isEmpty()) {\n                throw new IllegalArgumentException(\n                        \"Option --image-format requires a value. Supported values: png, jpeg\");\n            }\n            String format = formatValue.trim().toLowerCase(Locale.ROOT);\n            if (!Config.isValidImageFormat(format)) {\n                throw new IllegalArgumentException(\n                        String.format(\"Unsupported image format '%s'. Supported values: png, jpeg\", format));\n            }\n            config.setImageFormat(format);\n        }","sourceCodeStart":440,"sourceCodeEnd":476,"githubUrl":"https://github.com/opendataloader-project/opendataloader-pdf/blob/a7789b8e77dd05e2b8659eb3ea12fc458f80bfb8/java/opendataloader-pdf-core/src/main/java/org/opendataloader/pdf/api/cli/CLIOptions.java#L440-L476","documentation":"applyImageOptions trims and lowercases the --image-output value and checks Config.isValidImageOutput; if it is not in {off, embedded, external} it throws this message. Because config.setImageOutput is only called after this check passes, the Config-layer version of this error ([3]) does not fire when the value comes through the CLI. The CLI pre-check is case-insensitive.","triggerScenarios":"CLI --image-output base64, --image-output file, --image-output inline (common synonyms that are NOT accepted).","commonSituations":"Using a mode name borrowed from another tool (e.g. 'base64' instead of 'embedded', 'file' instead of 'external'); renamed value across versions; typo.","solutions":["Use one of the supported modes: off, embedded, or external.","Map synonyms before invoking: base64 -> embedded, file/path -> external.","Pre-validate with Config.isValidImageOutput(value.trim().toLowerCase(Locale.ROOT))."],"exampleFix":"# before: --image-output base64\n# after:  --image-output embedded","handlingStrategy":"validation","validationCode":"String mode = rawImageOutput.trim().toLowerCase(Locale.ROOT);\nif (!Config.isValidImageOutput(mode)) {\n    throw new IllegalArgumentException(\n        \"Unsupported --image-output '\" + mode + \"'. Valid: \" + Config.getImageOutputOptions(\", \"));\n}\nconfig.setImageOutput(mode);","typeGuard":"static boolean isSupportedImageOutput(String s) {\n    return s != null && Config.isValidImageOutput(s.trim().toLowerCase(Locale.ROOT));\n}","tryCatchPattern":"try { /* build config with --image-output */ }\ncatch (IllegalArgumentException e) { /* map synonyms or reprompt: off|embedded|external */ }","preventionTips":["Map common synonyms (base64->embedded, file->external) before invoking the CLI.","Validate with Config.isValidImageOutput so the error stays out of the library."],"tags":["configuration","validation","cli","image-output"],"backgroundTag":null,"analyzedSha":"a7789b8e77dd05e2b8659eb3ea12fc458f80bfb8","analyzedAt":"2026-08-14T05:22:03.953Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}