Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Ask HN: Why does the Windows Snip tool generate little endian PNG files?
2 points by ornornor on June 2, 2020 | hide | past | favorite
I was looking into an issue where a system would accept some PNG files and not others. For the rejected PNG files, the "official" solution was to slightly resize them with the Windows Snip tool and save them again which would then make the system happily accept the file.

I looked at one rejected file and one "snipped" file, and the difference was that the "snipped" file had turned little endian, when the original "problematic" file was big endian.

If I understand the spec correctly, PNG files should be in network byte order: https://www.w3.org/TR/2003/REC-PNG-20031110/#7Integers-and-byte-order

So why does the Windows Snip tool generate PNG files that aren't following the standard, and how does it even get any software at all to read its PNG (invalid) files?



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: