{"record":{"id":"8cd1951774eb4b7e","repo":"PaddlePaddle/PaddleOCR","slug":"min-pixels-cannot-be-greater-than-max-pixels","errorCode":null,"errorMessage":"min_pixels cannot be greater than max_pixels.","messagePattern":"min_pixels cannot be greater than max_pixels\\.","errorType":"validation","errorClass":"InvalidRequestError","httpStatus":null,"severity":"error","filePath":"paddleocr/_api_client/models.py","lineNumber":202,"sourceCode":"def _validate_vl_options(options: PaddleOCRVLOptions) -> None:\n    if options.top_p is not None and not (0 < options.top_p <= 1):\n        raise InvalidRequestError(\n            \"top_p must be greater than 0 and less than or equal to 1.\"\n        )\n    if options.temperature is not None and options.temperature < 0:\n        raise InvalidRequestError(\"temperature must be greater than or equal to 0.\")\n    if options.repetition_penalty is not None and options.repetition_penalty <= 0:\n        raise InvalidRequestError(\"repetition_penalty must be greater than 0.\")\n    if options.min_pixels is not None and options.min_pixels <= 0:\n        raise InvalidRequestError(\"min_pixels must be greater than 0.\")\n    if options.max_pixels is not None and options.max_pixels <= 0:\n        raise InvalidRequestError(\"max_pixels must be greater than 0.\")\n    if (\n        options.min_pixels is not None\n        and options.max_pixels is not None\n        and options.min_pixels > options.max_pixels\n    ):\n        raise InvalidRequestError(\"min_pixels cannot be greater than max_pixels.\")\n","sourceCodeStart":184,"sourceCodeEnd":203,"githubUrl":"https://github.com/PaddlePaddle/PaddleOCR/blob/2661c7c0ef5c613e8f93c6e93b2e052399f0f854/paddleocr/_api_client/models.py#L184-L203","documentation":"InvalidRequestError raised by _validate_vl_options when both min_pixels and max_pixels are set and min_pixels > max_pixels. The range would be empty, so the request is rejected client-side.","triggerScenarios":"PaddleOCRVLOptions(min_pixels=1000000, max_pixels=500000); swapping the two arguments; independently tuning each until they cross.","commonSituations":"Config drift where min is raised above an old max; parameter order mix-ups because both are plain ints.","solutions":["Swap or adjust the values so min_pixels <= max_pixels","Derive one from the other: max_pixels = max(min_pixels, max_pixels) before constructing options"],"exampleFix":"# before\noptions = PaddleOCRVLOptions(min_pixels=200704, max_pixels=100352)\n# after\noptions = PaddleOCRVLOptions(min_pixels=100352, max_pixels=200704)","handlingStrategy":"validation","validationCode":"if options.min_pixels is not None and options.max_pixels is not None:\n    assert options.min_pixels <= options.max_pixels, 'empty pixel range'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate the pair together whenever either is tuned","Derive max from min (or vice versa) in config code"],"tags":["validation","api-client","image-processing"],"backgroundTag":null,"analyzedSha":"2661c7c0ef5c613e8f93c6e93b2e052399f0f854","analyzedAt":"2026-08-14T20:17:30.180Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}