{"record":{"id":"14f871091dc53364","repo":"Wox-launcher/Wox","slug":"source-png-width-x-height-cannot-be-boxed-do","errorCode":null,"errorMessage":"{source_png} ({width}x{height}) cannot be boxed down to {size}x{size}","messagePattern":"(.+?) \\((.+?)x(.+?)\\) cannot be boxed down to (.+?)x(.+?)","errorType":"console","errorClass":"SystemExit","httpStatus":null,"severity":"error","filePath":"assets/linux/write_hicolor_icons.py","lineNumber":136,"sourceCode":"                for dx in range(factor):\n                    index = (row + (out_x * factor) + dx) * 4\n                    red += rgba[index]\n                    green += rgba[index + 1]\n                    blue += rgba[index + 2]\n                    alpha += rgba[index + 3]\n            offset = (out_y * out_width + out_x) * 4\n            output[offset : offset + 4] = bytes((red // area, green // area, blue // area, alpha // area))\n    return output\n\n\ndef write_hicolor_icons(source_png: pathlib.Path, destination_root: pathlib.Path, icon_file: str) -> None:\n    \"\"\"Write 64, 128, and 256 PNG icons so local .rpm/.deb installs show the app icon.\"\"\"\n    width, height, rgba = decode_rgba_png(source_png)\n    if width != height:\n        raise SystemExit(f\"{source_png} must be square\")\n    for size in HICOLOR_SIZES:\n        if width % size != 0:\n            raise SystemExit(f\"{source_png} ({width}x{height}) cannot be boxed down to {size}x{size}\")\n        sized = box_downsample(rgba, width, height, width // size) if size != width else bytearray(rgba)\n        output_path = destination_root / f\"{size}x{size}\" / icon_file\n        output_path.parent.mkdir(parents=True, exist_ok=True)\n        output_path.write_bytes(encode_rgba_png(size, size, sized))\n\n\nif __name__ == \"__main__\":\n    if len(sys.argv) != 4:\n        raise SystemExit(f\"Usage: {pathlib.Path(sys.argv[0]).name} SOURCE_PNG DEST_ROOT ICON_FILE\")\n    write_hicolor_icons(pathlib.Path(sys.argv[1]), pathlib.Path(sys.argv[2]), sys.argv[3])\n","sourceCodeStart":118,"sourceCodeEnd":147,"githubUrl":"https://github.com/Wox-launcher/Wox/blob/1659730fcb37154f26497e07308b1f8789d659fe/assets/linux/write_hicolor_icons.py#L118-L147","documentation":"Error \"{source_png} ({width}x{height}) cannot be boxed down to {size}x{size}\" thrown in Wox-launcher/Wox.","triggerScenarios":"Thrown at assets/linux/write_hicolor_icons.py:136 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"1659730fcb37154f26497e07308b1f8789d659fe","analyzedAt":"2026-08-15T23:31:07.596Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}