{ "name": "libjpeg-turbo", "version": "3.2.0", "summary": "libjpeg-turbo: JPEG with SIMD (the libjpeg API and libturbojpeg), for PHP's gd and ImageMagick", "category": "library", "license": "IJG AND BSD-3-Clause AND Zlib", "homepage": "https://libjpeg-turbo.org/", "source": { "url": "https://github.com/libjpeg-turbo/libjpeg-turbo/releases/download/3.2.0/libjpeg-turbo-3.2.0.tar.gz", "sha256": "6f30092cef9fb839779646608f4ee14ae3cbac989c47fa05e841b0841f09878e" }, "watch": {"kind": "github-release", "repo": "libjpeg-turbo/libjpeg-turbo", "tag_regex": "^([0-9]+(?:\\.[0-9]+)+[a-z]?[0-9]*)$"}, "deps": [], "env_packages": [ "nasm" ], "static": true, "nss": false, "check": "t=$(mktemp -d) && { printf 'P6\\n8 8\\n255\\n'; for i in $(seq 1 64); do printf '\\x80\\x40\\xc0'; done; } > \"$t/a.ppm\" && check_static bin/cjpeg bin/djpeg bin/jpegtran && bin/cjpeg -quality 95 \"$t/a.ppm\" > \"$t/a.jpg\" && bin/jpegtran -rotate 90 \"$t/a.jpg\" > \"$t/b.jpg\" && bin/djpeg -pnm \"$t/b.jpg\" > \"$t/b.ppm\" && [ \"$(head -c 11 \"$t/b.ppm\")\" = \"$(printf 'P6\\n8 8\\n255\\n')\" ] && [ \"$(wc -c < \"$t/b.ppm\")\" = 203 ] && check_lib libturbojpeg turbojpeg.h 'unsigned char px[16 * 16 * 3], back[16 * 16 * 3], *j = NULL; size_t n = 0; int w, h; for (int i = 0; i < 16 * 16; i++) { px[3 * i] = 200; px[3 * i + 1] = 100; px[3 * i + 2] = 50; } tjhandle c = tj3Init(TJINIT_COMPRESS); if (!c || tj3Set(c, TJPARAM_QUALITY, 100) || tj3Set(c, TJPARAM_SUBSAMP, TJSAMP_444) || tj3Compress8(c, px, 16, 0, 16, TJPF_RGB, &j, &n) || n < 100) return 1; tjhandle d = tj3Init(TJINIT_DECOMPRESS); if (!d || tj3DecompressHeader(d, j, n)) return 2; w = tj3Get(d, TJPARAM_JPEGWIDTH); h = tj3Get(d, TJPARAM_JPEGHEIGHT); if (w != 16 || h != 16 || tj3Decompress8(d, j, n, back, 0, TJPF_RGB)) return 3; for (int i = 0; i < (int) sizeof px; i++) if (abs(px[i] - back[i]) > 2) return 4; tj3Free(j); tj3Destroy(c); tj3Destroy(d)'; r=$?; rm -rf -- \"${t:?}\"; [ $r = 0 ] && echo \"libjpeg-turbo $(bin/cjpeg -version 2>&1 | sed -n 's/^libjpeg-turbo version \\([^ ]*\\).*/\\1/p'): cjpeg, jpegtran -rotate 90 and djpeg turn a PPM into a JPEG and back; libturbojpeg compresses a 16x16 image at quality 100 and decompresses it within 2 of each value\"; exit $r" }