{"record":{"id":"4cf5c1d306dceddc","repo":"calesthio/OpenMontage","slug":"image-is-unreadable-or-corrupt-source","errorCode":null,"errorMessage":"image is unreadable or corrupt: {source}","messagePattern":"image is unreadable or corrupt: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"tools/video/seedance_ark.py","lineNumber":1063,"sourceCode":"            self._validate_local_image(path)\n        elif label == \"audio\":\n            self._probe_local_audio_duration(path)\n        encoded = base64.b64encode(path.read_bytes()).decode(\"ascii\")\n        return f\"data:{mime};base64,{encoded}\"\n\n    def _validate_local_image(self, path: Path) -> None:\n        self._validate_image_bytes(path.read_bytes(), str(path))\n\n    @staticmethod\n    def _validate_image_bytes(data: bytes, source: str) -> None:\n        try:\n            from PIL import Image\n\n            with Image.open(io.BytesIO(data)) as image:\n                width, height = image.size\n                image.verify()\n        except Exception as exc:\n            raise ValueError(f\"image is unreadable or corrupt: {source}\") from exc\n        if not (300 <= width <= 6000 and 300 <= height <= 6000):\n            raise ValueError(\n                \"local image width and height must each be 300 to 6000 pixels\"\n            )\n        ratio = width / height\n        if not 0.4 <= ratio <= 2.5:\n            raise ValueError(\n                \"local image width/height ratio must be between 0.4 and 2.5\"\n            )\n\n    def _validate_data_uri(\n        self,\n        value: str,\n        *,\n        suffix_to_mime: dict[str, str],\n        max_bytes: int,\n        label: str,\n    ) -> str:","sourceCodeStart":1045,"sourceCodeEnd":1081,"githubUrl":"https://github.com/calesthio/OpenMontage/blob/95e1c3d0ab93482159818560f6a8c8e866b9139f/tools/video/seedance_ark.py#L1045-L1081","documentation":"Error \"image is unreadable or corrupt: {source}\" thrown in calesthio/OpenMontage.","triggerScenarios":"The reference image bytes cannot be decoded, indicating an unreadable or corrupt image file.","commonSituations":"See trigger scenarios.","solutions":["Re-export or re-download the image; the file bytes cannot be decoded.","Verify the source file opens in an image viewer and is not truncated or zero-byte."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"95e1c3d0ab93482159818560f6a8c8e866b9139f","analyzedAt":"2026-08-15T06:31:20.014Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}