← back to roto on ba3a.dev

withTotal

fun withTotal(webp: ByteArray, totalMs: Long): ByteArray

A copy of webp whose last ANMF frame lasts totalMs less the durations of the frames before it. A still WebP, with no ANMF chunk, comes back unchanged. Bytes that are not a whole WebP file, or a last duration outside 1 to 16777215 ms, are refused with an IllegalArgumentException.