image-rs / jpeg-decoder

JPEG decoder written in Rust
Apache License 2.0
147 stars 88 forks source link

useless double-check #129

Closed lovasoa closed 4 years ago

lovasoa commented 4 years ago

I was reading the code, and I realised that the planes of progressive JPEGs are iterated upon twice to check whether any of them is empty. I thought I would open an issue:

https://github.com/image-rs/jpeg-decoder/blob/master/src/decoder.rs#L344-L346

and

https://github.com/image-rs/jpeg-decoder/blob/master/src/decoder.rs#L773-L775

We may want to remove the second redundant check. compute_image is called only from decode_internal.