{"record":{"id":"5864e296844089a7","repo":"opendatalab/MinerU","slug":"not-support-limit-type-image","errorCode":null,"errorMessage":"not support limit type, image ","messagePattern":"not support limit type, image ","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"mineru/model/utils/pytorchocr/data/imaug/operators.py","lineNumber":261,"sourceCode":"            if max(h, w) > limit_side_len:\n                if h > w:\n                    ratio = float(limit_side_len) / h\n                else:\n                    ratio = float(limit_side_len) / w\n            else:\n                ratio = 1.\n        elif self.limit_type == 'min':\n            if min(h, w) < limit_side_len:\n                if h < w:\n                    ratio = float(limit_side_len) / h\n                else:\n                    ratio = float(limit_side_len) / w\n            else:\n                ratio = 1.\n        elif self.limit_type == 'resize_long':\n            ratio = float(limit_side_len) / max(h, w)\n        else:\n            raise Exception('not support limit type, image ')\n        resize_h = int(h * ratio)\n        resize_w = int(w * ratio)\n\n        if max(resize_h, resize_w) > self.max_side_limit:\n            ratio = float(self.max_side_limit) / max(resize_h, resize_w)\n            resize_h = int(resize_h * ratio)\n            resize_w = int(resize_w * ratio)\n\n        resize_h = max(int(round(resize_h / 32) * 32), 32)\n        resize_w = max(int(round(resize_w / 32) * 32), 32)\n\n        try:\n            if int(resize_w) <= 0 or int(resize_h) <= 0:\n                return None, (None, None)\n            img = cv2.resize(img, (int(resize_w), int(resize_h)))\n        except:\n            print(img.shape, resize_w, resize_h)\n            sys.exit(0)","sourceCodeStart":243,"sourceCodeEnd":279,"githubUrl":"https://github.com/opendatalab/MinerU/blob/4fe4bde114a23ee5dd637eae99b767f4669bf58c/mineru/model/utils/pytorchocr/data/imaug/operators.py#L243-L279","documentation":"Raised in the DetResizeForTest image operator (pytorchocr data augmentation) when limit_type is not one of 'max', 'min', or 'resize_long'. This operator resizes detection inputs to constrain a side length, and the string comes from the detection config's DetResizeForTest.limit_type key.","triggerScenarios":"A detection YAML/JSON config with image_shape-operator settings where limit_type is misspelled or omitted-with-bad-default (e.g. 'none', '', 'long'). Constructing DetResizeForTest(...) directly with an invalid limit_type also triggers it at first __call__.","commonSituations":"Hand-edited det configs copied from newer PaddleOCR versions whose limit_type vocabulary differs; merging configs where the key got dropped; typo like 'Resize_long'.","solutions":["Set limit_type in the DetResize for-test operator config to 'max', 'min', or 'resize_long'.","If you want plain resizing, many configs use limit_type: 'resize_long' with a limit_side_len value.","Compare against the det config shipped with mineru for your model version."],"exampleFix":"# before\nDetResizeForTest(limit_type=\"long\", limit_side_len=960)\n\n# after\nDetResizeForTest(limit_type=\"resize_long\", limit_side_len=960)","handlingStrategy":"validation","validationCode":"limit_type = ops_cfg.get(\"limit_type\")\nassert limit_type in {\"max\", \"min\", \"resize_long\"}, f\"bad limit_type: {limit_type!r}\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate det preprocessing configs against the supported limit_type vocabulary","Keep the stock preprocessing operator config unless you know the schema","Add config schema checks when merging YAMLs from other PaddleOCR versions"],"tags":["ocr","detection","preprocessing","config","validation"],"backgroundTag":null,"analyzedSha":"4fe4bde114a23ee5dd637eae99b767f4669bf58c","analyzedAt":"2026-08-14T21:29:18.456Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}