microsoft / lepton_jpeg_rust

Port of DropBox Lepton compression to Rust
Apache License 2.0
129 stars 10 forks source link

Bind output size during decompression #43

Closed gbrovman closed 1 year ago

gbrovman commented 1 year ago

During decompression, before writing the garbage data, bind the output to match the file plain text size. While this logic usually does nothing and seems unneeded, it matches the Lepton C++ implementation and solves a back-compat case for a JPEG file with trailing restarts that were missing in the original JPG.

gbrovman commented 1 year ago

Abandoning in a favor of Kristof's alternative solution