4 ms·
Why have not zero bits then? http://www.dangermouse.net/esoteric/lenpeg.html http://www.dangermouse.net/esoteric/lenpeg.html
by iso8859-1 11y ago
Why have not zero bits then? http://www.dangermouse.net/esoteric/lenpeg.html http://www.dangermouse.net/esoteric/lenpeg.html
- deathanatos 11y ago> Why have not zero bits then? LenPEG 2 contains a bug that will cause it to corrupt images. Let's say I have a custom compression algorithm (as allowed by LenPEG 2), let's call it "SurprisedBabyPEG"; it's steps are: 1. Is the image the "surprised baby gif"? If yes, write an empty file. 2. Otherwise, encode the input as PNG, and write that to the file as output. LenPEG 2 allows us to choose an encoding algorithm: > 2. Prompt the user to ask what other algorithm to use (GIF, JPEG, PNG, etc). Take the surprised baby gif, and feed it as input to LenPEG 2. It's not Lenna, so step 1 fails. We proceed with step 2, and it prompts us for an encoding algorithm; we choose "SurprisedBabyPEG". > 3. Use the user-suggested algorithm to compress the image and write it. SurprisedBabyPEG outputs the empty file; this is the same output as if we run Lenna through LenPEG 2; on decompression of our surprised baby, Lenna is incorrectly output. (This bug is correctable, and also affects LenPEG 3.) Also, (grep "`./smr`" < input || cat lenna) | xv - The linked smr.c does not link. This reminds me how you can communicate any finite sequence of octets across a network connection with only a two bits.
- jychang 11y agoDoesn't this bug affect LenPEG 1 then? An compression algo that returns "surprised baby gif" if it has a file with first bet set to 1... would match LenPEG 1.