Wox-launcher/Wox · error · SystemExit

{source_png} ({width}x{height}) cannot be boxed down to {siz

Error message

{source_png} ({width}x{height}) cannot be boxed down to {size}x{size}

What it means

Error "{source_png} ({width}x{height}) cannot be boxed down to {size}x{size}" thrown in Wox-launcher/Wox.

Source

Thrown at assets/linux/write_hicolor_icons.py:136

                for dx in range(factor):
                    index = (row + (out_x * factor) + dx) * 4
                    red += rgba[index]
                    green += rgba[index + 1]
                    blue += rgba[index + 2]
                    alpha += rgba[index + 3]
            offset = (out_y * out_width + out_x) * 4
            output[offset : offset + 4] = bytes((red // area, green // area, blue // area, alpha // area))
    return output


def write_hicolor_icons(source_png: pathlib.Path, destination_root: pathlib.Path, icon_file: str) -> None:
    """Write 64, 128, and 256 PNG icons so local .rpm/.deb installs show the app icon."""
    width, height, rgba = decode_rgba_png(source_png)
    if width != height:
        raise SystemExit(f"{source_png} must be square")
    for size in HICOLOR_SIZES:
        if width % size != 0:
            raise SystemExit(f"{source_png} ({width}x{height}) cannot be boxed down to {size}x{size}")
        sized = box_downsample(rgba, width, height, width // size) if size != width else bytearray(rgba)
        output_path = destination_root / f"{size}x{size}" / icon_file
        output_path.parent.mkdir(parents=True, exist_ok=True)
        output_path.write_bytes(encode_rgba_png(size, size, sized))


if __name__ == "__main__":
    if len(sys.argv) != 4:
        raise SystemExit(f"Usage: {pathlib.Path(sys.argv[0]).name} SOURCE_PNG DEST_ROOT ICON_FILE")
    write_hicolor_icons(pathlib.Path(sys.argv[1]), pathlib.Path(sys.argv[2]), sys.argv[3])

View on GitHub (pinned to 1659730fcb)

When it happens

Trigger: Thrown at assets/linux/write_hicolor_icons.py:136 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Wox-launcher/Wox@1659730fcb (2026-08-15). Data as JSON: /api/errors/14f871091dc53364. Report an issue: GitHub.