{"record":{"id":"1220a6db7ea4c80b","repo":"sgl-project/sglang","slug":"minimax-h3-image-material-has-no-positive-display","errorCode":null,"errorMessage":"MiniMax H3 image material has no positive display geometry","messagePattern":"MiniMax H3 image material has no positive display geometry","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/minimax_h3/material_io.py","lineNumber":381,"sourceCode":"    \"\"\"\n\n    if condition_type == \"image\":\n        try:\n            from PIL import Image, ImageOps\n\n            with Image.open(path) as image:\n                coded_width, coded_height = image.size\n                image_format = str(image.format or \"\").upper()\n                if coded_width <= 0 or coded_height <= 0:\n                    raise ValueError(\"image has no positive dimensions\")\n                display_image = ImageOps.exif_transpose(image)\n                width, height = display_image.size\n        except Exception as exc:\n            raise ValueError(\"MiniMax H3 image material is invalid\") from exc\n        if image_format not in {\"JPEG\", \"PNG\", \"WEBP\"}:\n            raise ValueError(\"MiniMax H3 image material uses an unsupported format\")\n        if width <= 0 or height <= 0:\n            raise ValueError(\n                \"MiniMax H3 image material has no positive display geometry\"\n            )\n        return {\n            \"condition_type\": \"image\",\n            \"coded_width\": int(coded_width),\n            \"coded_height\": int(coded_height),\n            \"display_width\": int(width),\n            \"display_height\": int(height),\n            \"image_format\": image_format,\n            \"exif_transposed\": (coded_width, coded_height) != (width, height),\n        }\n\n    if condition_type not in {\"audio\", \"video\", \"video_audio\"}:\n        raise ValueError(f\"unsupported MiniMax H3 condition type {condition_type!r}\")\n    try:\n        payload = _ffprobe_media(path)\n    except Exception as exc:\n        raise ValueError(\"MiniMax H3 media material is invalid\") from exc","sourceCodeStart":363,"sourceCodeEnd":399,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/minimax_h3/material_io.py#L363-L399","documentation":"The decoded image (after EXIF orientation transpose) has width or height <= 0. Only possible for degenerate or malformed images that PIL tolerates during decode but reports no real geometry for.","triggerScenarios":"Pathological image files where ImageOps.exif_transpose(image).size returns a zero dimension — crafted/corrupt files or exotic encoder output.","commonSituations":"Fuzzed/adversarial inputs, images produced by broken encoders, or zero-pixel placeholder images.","solutions":["Re-encode the image through a real tool (PIL/Pillow re-save or ImageMagick)","Reject the material at ingest with your own dimension check","If recurring, identify the producer creating degenerate images"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"from PIL import Image, ImageOps\nwith Image.open(path) as im:\n    w, h = ImageOps.exif_transpose(im).size\n    assert w > 0 and h > 0","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Re-encode untrusted images through PIL before submission","Reject zero-dimension images at ingest"],"tags":["minimax-h3","image-geometry","degenerate-image"],"backgroundTag":"invalid-image-metadata","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}