{"record":{"id":"0d6803eb372104b7","repo":"ATH-MaaS/Pixelle-Video","slug":"no-suitable-white-column-found-within-the-specifie","errorCode":null,"errorMessage":"No suitable white column found within the specified range","messagePattern":"No suitable white column found within the specified range","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"pixelle_video/services/api_services/image_processor.py","lineNumber":94,"sourceCode":"                    white_sections.append((start_index, col))\n                    in_white_section = False\n\n        if in_white_section:\n            white_sections.append((start_index, end))\n\n        return white_sections\n\n    def split_image(self):\n        \"\"\"将图片从中间分割为左右两部分\"\"\"\n        start_col = self.width * 2 // 5\n        end_col = self.width * 3 // 5\n        white_sections = self.find_white_section(start_col, end_col)\n\n        if white_sections:\n            middle_section = white_sections[len(white_sections) // 2]\n            mid_col = (middle_section[0] + middle_section[1]) // 2\n        else:\n            raise ValueError(\"No suitable white column found within the specified range\")\n\n        left_box = (0, 0, mid_col, self.height)\n        right_box = (mid_col, 0, self.width, self.height)\n        left_image = self.image.crop(left_box)\n        right_image = self.image.crop(right_box)\n\n        save_dir, filename = os.path.split(self.image_path)\n        base, extension = os.path.splitext(filename)\n\n        left_image_path = os.path.join(save_dir, base + '_front' + extension)\n        right_image_path = os.path.join(save_dir, base + '_back' + extension)\n        left_image.save(left_image_path)\n        right_image.save(right_image_path)\n\n        return left_image_path, right_image_path\n    \n    def stitch_images(self, image_paths, output_path):\n        \"\"\"拼接多张图片\"\"\"","sourceCodeStart":76,"sourceCodeEnd":112,"githubUrl":"https://github.com/ATH-MaaS/Pixelle-Video/blob/848b054e4fae40dabc62ec58e960b573e83793ac/pixelle_video/services/api_services/image_processor.py#L76-L112","documentation":"split_image searches a column range for white columns (used to split a composed two-panel image at its white divider) and raises ValueError when find_white_section returns nothing in that range. This means the assumed white gutter between the halves does not exist where expected.","triggerScenarios":"Calling split_image with a start_col/end_col range where no fully-white vertical column exists — e.g. images that are not side-by-side composites, colored/gradient gutters, gutter outside the given range, or compressed images with noisy (non-pure-white) dividers.","commonSituations":"Splitting an image that was never stitched by this library, threshold too strict for JPEG-compressed near-white columns, wrong start/end column bounds passed for a differently sized composite.","solutions":["Widen the start_col/end_col range to cover the actual gutter location.","Relax the white-detection threshold in find_white_section (e.g. allow near-white >= 245 instead of 255) to tolerate compression noise.","Verify the input is actually a stitched two-panel composite produced with matching dimensions.","Log white_sections / column brightness to locate the gutter before calling split_image."],"exampleFix":"// before\nleft, right = processor.split_image(0, processor.width // 2)  # gutter may be right of center\n\n// after\nleft, right = processor.split_image(0, processor.width)  # search full width for the gutter","handlingStrategy":"validation","validationCode":"def looks_like_composite(img) -> bool:\n    w, h = img.size\n    return w >= 2 * h * 0.5  # sanity: wide enough to be side-by-side\n# verify range covers the gutter\nassert 0 <= start_col < end_col <= processor.width","typeGuard":"def has_white_gutter(processor, start_col, end_col) -> bool:\n    return bool(processor.find_white_section(start_col, end_col))","tryCatchPattern":"try:\n    left, right = processor.split_image(start_col, end_col)\nexcept ValueError:\n    left, right = processor.split_image(0, processor.width)  # widen search range","preventionTips":["Only split images that were stitched as side-by-side composites","Search the full width if the gutter position is unknown","Allow near-white thresholds to tolerate JPEG compression noise","Debug with find_white_section directly before splitting"],"tags":["image-processing","valueerror","split"],"backgroundTag":"no-matching-region-found","analyzedSha":"848b054e4fae40dabc62ec58e960b573e83793ac","analyzedAt":"2026-08-30T03:24:41.468Z","schemaVersion":2},"datasetVersion":"2026-08-30T08:17:16.595Z"}