discord / lilliput

Resize images and animated GIFs in Go
https://discord.com/blog/how-discord-resizes-150-million-images-every-day-with-go-and-c
Other
1.95k stars 123 forks source link

[lilliput] Add jpeg content length detection #125

Closed walruscow closed 1 year ago

walruscow commented 1 year ago

Walk jpeg segments to find EOI and report content length accurately Sadly this seems to require a linear scan of most of the content

a jpeg file consists of a sequence of segments

Add a couple unit tests for jpeg data

walruscow commented 1 year ago

Nope, some segment is not entropy coded so we can't just search for 0xFF