{ "name": "optipng", "version": "7.9.1", "summary": "OptiPNG: lossless PNG recompression (optipng -o2 and up), and BMP, GIF, PNM and TIFF to PNG", "category": "tool", "license": "Zlib", "homepage": "https://optipng.sourceforge.net/", "source": { "url": "https://downloads.sourceforge.net/project/optipng/OptiPNG/optipng-7.9.1/optipng-7.9.1.tar.gz", "sha256": "c2579be58c2c66dae9d63154edcb3d427fef64cb00ec0aff079c9d156ec46f29" }, "watch": { "kind": "index", "url": "https://deb.debian.org/debian/pool/main/o/optipng/", "regex": "optipng_([0-9]+\\.[0-9]+\\.[0-9]+)\\+ds\\.orig\\.tar\\.xz" }, "deps": [ "libpng", "zlib" ], "env_packages": [], "static": true, "nss": false, "check": "t=$(mktemp -d) && bin/optipng -v | has '^OptiPNG version 7\\.9\\.1' && python3 -c 'import sys, zlib, struct; w = h = 32; raw = b\"\".join(b\"\\0\" + bytes(v for x in range(w) for v in ((x * 8) % 256, (y * 8) % 256, ((x + y) * 4) % 256, 255)) for y in range(h)); c = lambda t, d: struct.pack(\">I\", len(d)) + t + d + struct.pack(\">I\", zlib.crc32(t + d)); open(sys.argv[1], \"wb\").write(b\"\\x89PNG\\r\\n\\x1a\\n\" + c(b\"IHDR\", struct.pack(\">IIBBBBB\", w, h, 8, 6, 0, 0, 0)) + c(b\"IDAT\", zlib.compress(raw, 0)) + c(b\"IEND\", b\"\"))' \"$t/a.png\" && s0=$(stat -c %s \"$t/a.png\") && bin/optipng -quiet -o2 -strip all -out \"$t/o.png\" \"$t/a.png\" && s1=$(stat -c %s \"$t/o.png\") && [ \"$s1\" -lt \"$s0\" ] && bin/pngfix \"$t/o.png\" > /dev/null && od -An -tx1 -N8 \"$t/o.png\" | tr -d ' \\n' | has -x 89504e470d0a1a0a && [ -s share/doc/optipng/LICENSE.txt ] && echo \"optipng 7.9.1: an uncompressed 32x32 RGBA PNG recompressed losslessly with -o2 ($s0 to $s1 bytes), read by libpng's pngfix without an error; its licence in share/doc/optipng\"" }