{"record":{"id":"ea6add57fee038ec","repo":"dgtlmoon/changedetection.io","slug":"bounding-box-values-are-too-large","errorCode":null,"errorMessage":"Bounding box values are too large","messagePattern":"Bounding box values are too large","errorType":"validation","errorClass":"ValidationError","httpStatus":null,"severity":"warning","filePath":"changedetectionio/processors/image_ssim_diff/forms.py","lineNumber":31,"sourceCode":"def validate_bounding_box(form, field):\n    \"\"\"Validate bounding box format: x,y,width,height with integers.\"\"\"\n    if not field.data:\n        return  # Optional field\n\n    if len(field.data) > 100:\n        raise ValidationError(_l('Bounding box value is too long'))\n\n    # Should be comma-separated integers\n    if not re.match(r'^\\d+,\\d+,\\d+,\\d+$', field.data):\n        raise ValidationError(_l('Bounding box must be in format: x,y,width,height (integers only)'))\n\n    # Validate values are reasonable (not negative, not ridiculously large)\n    parts = [int(p) for p in field.data.split(',')]\n    for part in parts:\n        if part < 0:\n            raise ValidationError(_l('Bounding box values must be non-negative'))\n        if part > 10000:  # Reasonable max screen dimension\n            raise ValidationError(_l('Bounding box values are too large'))\n\n\ndef validate_selection_mode(form, field):\n    \"\"\"Validate selection mode value.\"\"\"\n    if not field.data:\n        return  # Optional field\n\n    if field.data not in ['element', 'draw']:\n        raise ValidationError(_l('Selection mode must be either \"element\" or \"draw\"'))\n\n\nclass processor_settings_form(processor_text_json_diff_form):\n    \"\"\"Form for fast image comparison processor settings.\"\"\"\n\n    processor_config_min_change_percentage = IntegerField(\n        _l('Minimum Change Percentage'),\n        validators=[\n            validators.Optional(),","sourceCodeStart":13,"sourceCodeEnd":49,"githubUrl":"https://github.com/dgtlmoon/changedetection.io/blob/5d9c7c6da76340597243e8163c4f2439237fa0e8/changedetectionio/processors/image_ssim_diff/forms.py#L13-L49","documentation":"Each of the four bounding-box integers must be ≤ 10000 (a reasonable maximum screen dimension). Values above that raise ValidationError, preventing absurd crop regions that would break or slow the SSIM image diff.","triggerScenarios":"Submitting coordinates or dimensions greater than 10000, e.g. '0,0,20000,20000' for a huge screenshot, or a width/height computed as x2/y2 end-coordinates from a tool that reports absolute pixel extents of very large images.","commonSituations":"Full-page screenshots of very long pages where height legitimately exceeds 10000px; confusion between width/height and right/bottom coordinates; retina/zoom-scaled coordinates doubling the expected values.","solutions":["Clamp each value to ≤10000, or crop the region to a sub-area under the limit","Verify you are supplying width/height, not x2/y2 end coordinates","If the source image really is taller than 10000px, pre-scale or split the watch into regions"],"exampleFix":"# before\nbounding_box = '0,0,19200,43200'\n# after\nbounding_box = '0,0,1920,1080'  # use actual width/height, not end coords","handlingStrategy":"validation","validationCode":"parts = [int(p) for p in bbox.split(',')]\nif any(p > 10000 for p in parts):\n    parts = [min(p, 10000) for p in parts]  # or reject\nbbox = ','.join(map(str, parts))","typeGuard":"def bbox_within_limits(s: str, limit: int = 10000) -> bool:\n    return all(int(p) <= limit for p in s.split(','))","tryCatchPattern":null,"preventionTips":["Supply width/height, not end coordinates","Pre-scale very large screenshots or split into multiple watch regions"],"tags":["wtforms","validation","bounding-box","image-diff"],"backgroundTag":"form-validation-failed","analyzedSha":"5d9c7c6da76340597243e8163c4f2439237fa0e8","analyzedAt":"2026-08-27T19:41:16.067Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}