import { execFile } from "child_process"; import { mkdtemp, readFile, rm, writeFile } from "fs/promises"; import { tmpdir } from "os"; import path from "path"; import sharp from "sharp"; // Animated GIFs are decoded frame by frame on the CPU for as long as they are // on screen (a large one costs a fifth of a core continuously, and the decode // competes with canvas raster during zooms), while a muted looping