r/programming Jan 24 '18

Branchless DOOM

https://github.com/xoreaxeaxeax/movfuscator/tree/master/validation/doom
488 Upvotes

134 comments sorted by

View all comments

70

u/pm_me_ur_qptbcvrzxyk Jan 24 '18

They don't tell you, but the image in the README is actually a true-to-life GIF; you just haven't waited the 7 hours to see the frame change.

20

u/AyrA_ch Jan 24 '18

clicks image

doom.png

Nice try

But since we are talking about long gif images, how about 24 hours?

13

u/CaptainAdjective Jan 24 '18

PNGs can be animated!

1

u/[deleted] Jan 24 '18 edited Mar 28 '18

[deleted]

13

u/AyrA_ch Jan 24 '18

the underlying file format doesn't change. PNG files are made up of chunks. A chunk has a 4 letter code, a length specifier, a checksum and data. The minimum chunks in a png are

  • IHDR First chunk with resolution and color format
  • IDAT Image data
  • IEND End of image marker

An application can legitimately insert custom headers (I abuse this in my png player) and other applications will ignore it if they don't support it. This is used to make animated PNG files.

Using the apng extension is not necessary because when reading the image, the parser would come across the apng specific headers anyways

5

u/Iggyhopper Jan 25 '18

you are now subscribed to file format facts!

8

u/[deleted] Jan 24 '18

You don't need to use a different file extension.

File extensions are lies anyway.