{"record":{"id":"c3cf6fc558f6e166","repo":"calesthio/OpenMontage","slug":"decoded-label-data-uri-must-be-smaller-than-max","errorCode":null,"errorMessage":"decoded {label} Data URI must be smaller than {max_bytes // (1024 * 1024)} MB","messagePattern":"decoded (.+?) Data URI must be smaller than (.+?) MB","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"tools/video/seedance_ark.py","lineNumber":1120,"sourceCode":"        match = re.fullmatch(\n            r\"data:([a-z]+/[a-z0-9.+-]+);base64,([A-Za-z0-9+/=]+)\",\n            value,\n            flags=re.IGNORECASE,\n        )\n        if not match:\n            raise ValueError(\n                f\"{label} Data URI must use a supported MIME type and \"\n                \"strict base64 encoding\"\n            )\n        mime = match.group(1).lower()\n        if mime not in set(suffix_to_mime.values()):\n            raise ValueError(f\"unsupported {label} Data URI MIME type: {mime}\")\n        try:\n            decoded = base64.b64decode(match.group(2), validate=True)\n        except (ValueError, binascii.Error) as exc:\n            raise ValueError(f\"invalid base64 in {label} Data URI\") from exc\n        if len(decoded) >= max_bytes:\n            raise ValueError(\n                f\"decoded {label} Data URI must be smaller than \"\n                f\"{max_bytes // (1024 * 1024)} MB\"\n            )\n        return mime, decoded\n\n    def _local_or_data_audio_duration(\n        self, value: str, *, max_seconds: int = 15\n    ) -> float | None:\n        if value.startswith(\"data:\"):\n            mime, decoded = self._decode_data_uri(\n                value,\n                suffix_to_mime=self.AUDIO_SUFFIX_TO_MIME,\n                max_bytes=self.MAX_AUDIO_BYTES,\n                label=\"audio\",\n            )\n            return self._probe_audio_bytes(decoded, mime, max_seconds=max_seconds)\n        if self._is_remote_or_asset(value):\n            return None","sourceCodeStart":1102,"sourceCodeEnd":1138,"githubUrl":"https://github.com/calesthio/OpenMontage/blob/95e1c3d0ab93482159818560f6a8c8e866b9139f/tools/video/seedance_ark.py#L1102-L1138","documentation":"Error \"decoded {label} Data URI must be smaller than {max_bytes // (1024 * 1024)} MB\" thrown in calesthio/OpenMontage.","triggerScenarios":"The decoded bytes of a reference Data URI exceed the maximum allowed size in megabytes.","commonSituations":"See trigger scenarios.","solutions":["Reduce the decoded image size below the stated MB limit by resizing or recompressing before encoding.","Alternatively host the image at a URL and pass the URL instead of a Data URI."],"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"}