{"record":{"id":"bdd4bcbad6a056bc","repo":"PaddlePaddle/PaddleOCR","slug":"max-pixels-must-be-greater-than-0","errorCode":null,"errorMessage":"max_pixels must be greater than 0.","messagePattern":"max_pixels must be greater than 0\\.","errorType":"validation","errorClass":"InvalidRequestError","httpStatus":null,"severity":"error","filePath":"paddleocr/_api_client/models.py","lineNumber":196,"sourceCode":"            payload.update(value)\n        else:\n            payload[snake_to_camel(field.name)] = value\n    return payload\n\n\ndef _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":178,"sourceCodeEnd":203,"githubUrl":"https://github.com/PaddlePaddle/PaddleOCR/blob/2661c7c0ef5c613e8f93c6e93b2e052399f0f854/paddleocr/_api_client/models.py#L178-L203","documentation":"InvalidRequestError raised by _validate_vl_options when PaddleOCRVLOptions.max_pixels is <= 0. max_pixels caps the processed image area for the VL model and must be positive.","triggerScenarios":"PaddleOCRVLOptions(max_pixels=0) or a negative number; integer overflow or unit mistakes producing zero/negative values.","commonSituations":"Copy-pasting config where max_pixels is expressed in megapixels or side length; attempting to disable the cap with 0.","solutions":["Set max_pixels to a positive pixel area (e.g. 16384*28*28-style limits from model configs)","Leave it None for the default"],"exampleFix":"# before\noptions = PaddleOCRVLOptions(max_pixels=0)\n# after\noptions = PaddleOCRVLOptions(max_pixels=12845056)","handlingStrategy":"validation","validationCode":"if options.max_pixels is not None:\n    assert options.max_pixels > 0, 'max_pixels must be positive pixel area'","typeGuard":null,"tryCatchPattern":"from paddleocr._api_client.errors import InvalidRequestError\n\ntry:\n    run(options)\nexcept InvalidRequestError as e:\n    if 'max_pixels' in str(e):\n        options.max_pixels = None  # server default\n    else:\n        raise","preventionTips":["Copy pixel limits from the model card rather than inventing values","There is no '0 = unlimited'; use None"],"tags":["validation","api-client","image-processing"],"backgroundTag":null,"analyzedSha":"2661c7c0ef5c613e8f93c6e93b2e052399f0f854","analyzedAt":"2026-08-14T20:17:30.180Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}